A method for detecting visual abnormality of a circuit board

Through the image decomposition and correction methods of convolutional neural network, the problem of insufficient clarity of circuit board images under dark light conditions is solved, and efficient circuit board detection effect is achieved.

CN119251135BActive Publication Date: 2025-09-02WUHAN MARINE MACHINERY PLANT
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411052784.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-02
Publication Date
2025-09-02
Estimated Expiration
2044-08-02

AI Technical Summary

Technical Problem

The existing circuit board visual detection methods have poor sharpness in pictures taken under dark light conditions, resulting in poor detection results.

Method used

The image decomposition and correction method of convolutional neural network is used to extract feature and calculate the light parameters of dark light images through the first and second convolutional layers. The image decomposition module group and correction module group are used to process the dark light feature maps in multiple scales, filter and improve key features, and reconstruct them into pictures with normal brightness.

Benefits of technology

It improves the clarity and effective details of the circuit board pictures, enhances the accuracy and stability of detection, and improves the accuracy of fault detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119251135B_ABST
    Figure CN119251135B_ABST
Patent Text Reader

Abstract

A method for detecting visual abnormalities in a circuit board comprises the following steps: first, obtaining a dark-light image; second, obtaining a dark-light feature map, decomposing the dark-light feature map into multiple sub-bands of different frequencies, and then reconstructing all of the sub-bands into a complete dark-light feature map, thereby obtaining illumination parameters; third, obtaining the dark-light feature map, decomposing the dark-light feature map into multiple sub-bands of different frequencies, then enhancing the brightness of all of the sub-bands according to the illumination parameters, and then reconstructing all of the sub-bands into feature maps of normal brightness, and finally outputting an image of normal brightness; correcting the circuit board image taken under dark-light conditions to an image of normal brightness, thereby achieving higher image clarity; and during the aforementioned process, multiple screening steps are performed to retain key features in the sub-bands, resulting in a higher number of effective details in the image. Therefore, the circuit board image of this design achieves better clarity and more effective details.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a circuit board detection method, belongs to the technical field of visual state abnormality detection, and in particular to a circuit board visual abnormality detection method. Background Art

[0002] After the circuit board is manufactured, the surface defects of the electronic components on the circuit board need to be inspected to ensure its quality. However, traditional manual inspection methods require a lot of manpower and time. Not only are they inefficient, but they are also easily affected by human factors, leading to false detection and missed detection. Currently, a visual inspection method has emerged that photographs the circuit board and then inspects the image.

[0003] A Chinese patent application with application number 202410437300.X and application date April 12, 2024 discloses a circuit board inspection system and inspection method. The inspection system includes a fixed frame a, with rotating disks rotatably provided at both ends of the fixed frame a, a belt is provided between the two rotating disks, and multiple groups of clamping units are provided between the two belts. A detection unit is provided above the fixed frame a; the detection unit includes a connecting frame a mounted on the fixed frame a, and a linear drive member a is mounted on the connecting frame a. Although this design uses a camera to photograph the circuit board for visual inspection, thereby solving the problem of time-consuming and labor-intensive manual inspection, it still has the following defects:

[0004] If the circuit board is photographed under normal lighting conditions, there will be reflections on the surface of the circuit board, and the details of the electronic components on the surface of the circuit board cannot be preserved in the reflections. Therefore, the circuit board needs to be photographed under low light conditions; however, when this design is used under low light conditions, the brightness of the circuit board image taken is darker, which will result in poor clarity of the circuit board image taken.

[0005] The information disclosed in this background technology section is only intended to increase understanding of the overall background of the application and should not be considered as an admission or any form of suggestion that the information constitutes the prior art already known to ordinary technicians in this field. Summary of the Invention

[0006] The purpose of the present invention is to overcome the problem of poor clarity of circuit board images in the prior art and to provide a method for detecting visual abnormalities of a circuit board with better clarity of the circuit board images.

[0007] To achieve the above objectives, the technical solution of the present invention is:

[0008] A method for detecting visual abnormality of a circuit board comprises the following steps:

[0009] Step 1: First, take a picture of the circuit board to obtain a dark light picture;

[0010] Step 2: First, the first convolutional layer convolves the dark-light image to obtain a dark-light feature map, and then starts the image calculation process. The image calculation process is as follows: the first image decomposition module group decomposes the dark-light feature map into multiple sub-bands of different frequencies, and then the first image decomposition module group performs dimensionality reduction and feature extraction on all sub-bands to screen and retain the key features in the sub-bands. Then, the image stitching module group performs dimensionality reduction and feature extraction on all sub-bands to further screen and retain the key features in the sub-bands. Then, the image stitching module group reconstructs all sub-bands into a complete dark-light feature map. At this time, the multi-scale illumination parameters are obtained by the image calculation process.

[0011] Step 3: First, the second convolutional layer convolves the dark-light image to obtain a dark-light feature map. Then, the second image decomposition module group decomposes the dark-light feature map into multiple sub-bands of different frequencies. Then, the second image decomposition module group performs dimensionality reduction and feature extraction on all sub-bands to screen and retain the key features in the sub-bands. Then, the image correction module group performs dimensionality reduction and feature extraction on all sub-bands to further screen and retain the key features in the sub-bands. Then, the image correction module group converts the spatial domain of all sub-bands into the frequency domain to highlight the features in the sub-bands that need dark-light repair. Then, the image correction module group enhances the brightness of the features that need dark-light repair in all sub-bands according to multi-scale illumination parameters, and then obtains sub-bands with normal illumination information. Then, the sub-bands are converted from the frequency domain to the spatial domain. Then, the image correction module group reconstructs all sub-bands into feature maps with normal brightness. Then, the third convolutional layer performs dimensionality reduction and feature extraction on the feature maps to further increase the features, and then outputs an image with normal brightness.

[0012] In the second step, the first image decomposition module group includes three first image decomposition modules, each of which decomposes the dark-light feature map into multiple sub-bands of different frequencies, and then the first image decomposition module performs dimensionality reduction and feature extraction on all sub-bands.

[0013] In the second step, the first image decomposition module includes a first attention wavelet transform module and a first residual module. The first image decomposition module decomposes the dark-light feature map into multiple sub-bands of different frequencies. The first image decomposition module performs dimensionality reduction and feature extraction on all sub-bands. The first residual module performs dimensionality reduction and feature extraction on all sub-bands.

[0014] In the second step, the image stitching module group includes three image stitching modules, each image stitching module performs dimensionality reduction and feature extraction on all sub-bands, and then the image stitching module reconstructs all sub-bands into a complete dark-light feature map.

[0015] The image stitching module includes a stitching residual module and a stitching attention inverse wavelet transform module. The image stitching module performs dimensionality reduction and feature extraction on all sub-bands. The image stitching module reconstructs all sub-bands into a complete dark-light feature map. The stitching attention inverse wavelet transform module reconstructs all sub-bands into a complete dark-light feature map.

[0016] In the third step, the second image decomposition module group includes three second image decomposition modules, each of which decomposes the dark-light feature map into multiple sub-bands of different frequencies, and then the second image decomposition module performs dimensionality reduction and feature extraction on all sub-bands.

[0017] In the third step, the second image decomposition module includes a second attention wavelet transform module and a second residual module. The second image decomposition module decomposes the dark-light feature map into multiple sub-bands of different frequencies. The second image decomposition module performs dimensionality reduction and feature extraction on all sub-bands. The second residual module performs dimensionality reduction and feature extraction on all sub-bands.

[0018] In the third step, the image correction module group includes three image correction modules. The image correction modules all perform dimensionality reduction and feature extraction on all sub-bands, and then the image correction modules convert the spatial domains of all sub-bands into the frequency domain to highlight the features in the sub-bands that require dark light repair. The image correction modules then enhance the brightness of the features in all sub-bands that require dark light repair according to the illumination parameters, and then obtain sub-bands with normal illumination information. The sub-bands are then converted from the frequency domain into the spatial domain, and then the image correction modules reconstruct all sub-bands into feature maps with normal brightness.

[0019] In the third step, the image correction module includes a correction residual module, a frequency feature transformation module and a correction attention inverse wavelet transformation module. The image correction module performs dimensionality reduction and feature extraction on all sub-bands; the image correction module converts the spatial domain of all sub-bands into the frequency domain; the frequency feature transformation module converts the spatial domain of all sub-bands into the frequency domain; the image correction module enhances the brightness of the features that need dark light repair in all sub-bands according to the illumination parameters; the image correction module reconstructs all sub-bands into feature maps with normal brightness; the correction attention inverse wavelet transformation module reconstructs all sub-bands into feature maps with normal brightness.

[0020] In the second step, a residual connection is set between the first image decomposition module group and the image stitching module group; in the third step, a residual connection is set between the second image decomposition module group and the image correction module group.

[0021] Compared with the prior art, the present invention has the following beneficial effects:

[0022] 1. In a method for detecting visual abnormality of a circuit board according to the present invention, the method comprises the following steps: a first step: first obtaining a dark light picture of the circuit board; a second step: first convolving the dark light picture by a first convolution layer to obtain a dark light feature map, then decomposing the dark light feature map into multiple sub-bands of different frequencies by a first image decomposition module group, and then reconstructing the multiple sub-bands of different frequencies into a complete dark light feature map by an image stitching module group, at this time, obtaining multi-scale illumination parameters; a third step: first convolving the dark light picture by a second convolution layer to obtain a dark light feature map, then decomposing the dark light feature map into multiple sub-bands of different frequencies by a second image decomposition module group, and then correcting and reconstructing the sub-bands according to the multi-scale illumination parameters by an image correction module group to obtain a feature map with normal brightness, and then convolving the feature map by a third convolution layer to further increase features, and then outputting a picture of normal brightness. The advantages of the present invention also include:

[0023] First point: The present invention decomposes the feature map of the first image decomposition module group to obtain sub-bands of multiple frequencies, and then reconstructs the sub-bands of multiple frequencies by the image stitching module group to obtain multi-scale illumination parameters. Then, the feature map of the second image decomposition module group is decomposed to obtain sub-bands of multiple frequencies, and then the image correction module group performs brightness enhancement and reconstruction on the sub-bands according to the multi-scale illumination parameters to obtain a picture of normal brightness. Therefore, the present invention can correct a circuit board picture taken under dark light conditions to a circuit board picture of normal brightness, so the clarity of the circuit board picture is better;

[0024] Second point: The first image decomposition module group, the image stitching module group, the second image decomposition module group, and the image correction module group all perform dimensionality reduction and feature extraction on the sub-bands, which not only reduces unnecessary features in the feature map but also filters and retains key features in the sub-bands, resulting in more effective details in the image;

[0025] Third point: Because the present invention can improve the clarity of the image and the image has more effective details, it is conducive to the accurate recognition of the circuit board in the subsequent program;

[0026] Therefore, the circuit board image of the present invention has better clarity and more effective details.

[0027] 2. In a method for detecting visual abnormalities in a circuit board according to the present invention, in the first step, the first image decomposition module group includes three first image decomposition modules, each of which includes a first attention wavelet transform module and a first residual module. The image stitching module group includes three image stitching modules, each of which includes a stitching residual module and a stitching attention inverse wavelet transform module. When applied, the first attention wavelet transform module first decomposes the dark-light feature map into multiple sub-bands of different frequencies, and then the first residual module performs dimensionality reduction and feature extraction on all sub-bands to screen and retain key features in the sub-bands. The aforementioned process is repeated three times; then the stitching residual module performs dimensionality reduction and feature extraction on all sub-bands to screen and retain key features in the sub-bands, and then the stitching attention inverse wavelet transform module reconstructs the sub-bands into a complete dark-light feature map. The aforementioned process is repeated three times. The number of repetitions is large, so more accurate multi-scale illumination parameters can be obtained, which can improve the correction effect of the sub-bands in the third step. Therefore, the illumination parameters of the present invention are more accurate.

[0028] 3. In a circuit board visual abnormality detection method of the present invention, in the second step, the second image decomposition module group includes a second image decomposition module, each of which includes an attention wavelet transform module and a second residual module. The image correction module group includes three image correction modules, including a correction residual module, a frequency feature transform module, and an attention wavelet inverse transform module. When applied, the second attention wavelet transform module first decomposes the dark-light feature map into multiple sub-bands of different frequencies, and then the second residual module performs dimensionality reduction and feature extraction on all sub-bands to screen and retain key features in the sub-bands, and repeats the above process three times; then the correction residual module performs dimensionality reduction and feature extraction on all sub-bands to screen and retain key features in the sub-bands, and then the frequency feature transform module performs brightness enhancement on the dark-light features of the sub-bands to complete illumination correction, and then the attention wavelet inverse transform module reconstructs the sub-bands into an image with normal brightness, and repeats the above process three times; the correction residual module, frequency feature transform module, and attention wavelet inverse transform module gradually improve the reconstructed image accuracy during repeated processing. Therefore, the image accuracy of the present invention is high.

[0029] 4. In the circuit board visual abnormality detection method of the present invention, in the second step, a residual connection is provided between the first image decomposition module group and the image stitching module group; in the third step, a residual connection is provided between the second image decomposition module group and the image correction module group. When applied, the residual connection can effectively solve the gradient vanishing and gradient exploding problems during the use of the present invention, thereby improving the stability of the present invention during use. Therefore, the present invention has better stability. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] Figure 1It is a structural schematic diagram of the present invention.

[0031] Figure 2 yes Figure 1 Schematic diagram of the structure of the first image decomposition module group.

[0032] Figure 3 yes Figure 2 Schematic diagram of the structure of the first image decomposition module.

[0033] Figure 4 yes Figure 1 Schematic diagram of the structure of the image stitching module group.

[0034] Figure 5 yes Figure 4 Schematic diagram of the structure of the image stitching module.

[0035] Figure 6 yes Figure 1 Schematic diagram of the structure of the second image decomposition module group.

[0036] Figure 7 yes Figure 6 Schematic diagram of the structure of the second image decomposition module.

[0037] Figure 8 yes Figure 1 Schematic diagram of the structure of the image correction module group.

[0038] Figure 9 yes Figure 8 Schematic diagram of the structure of the image correction module.

[0039] Figure 10 It is a structural diagram of the circuit board in Example 1.

[0040] Figure 11 yes Figure 3 Schematic diagram of the structure of the first residual module in .

[0041] Figure 12 It is a schematic diagram of the application results of the present invention.

[0042] In the figure: the first convolutional layer 1, the first image decomposition module group 2, the first image decomposition module 21, the first attention wavelet transform module 211, the first residual module 212, the image stitching module group 3, the image stitching module 31, the stitching residual module 311, the stitching attention inverse wavelet transform module 312, the second convolutional layer 4, the second image decomposition module group 5, the second image decomposition module 51, the second attention wavelet transform module 511, the second residual module 512, the image correction module group 6, the image correction module 61, the corrected residual module 611, the frequency feature transformation module 612, the corrected attention inverse wavelet transform module 613, the third convolutional layer 7, the residual connection 8, the circuit board 9, the convolutional layer 101, and the activation layer 102. DETAILED DESCRIPTION

[0043] The present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0044] See Figure 1 — Figure 12 A method for detecting visual abnormality of a circuit board comprises the following steps:

[0045] Step 1: First, take a picture of the circuit board 9 to obtain a dark light picture;

[0046] Step 2: First, the first convolutional layer 1 convolves the dark-light image to obtain a dark-light feature map, and then starts the image calculation process. The image calculation process is as follows: the first image decomposition module group 2 decomposes the dark-light feature map into multiple sub-bands of different frequencies, and then the first image decomposition module group 2 performs dimensionality reduction and feature extraction on all sub-bands to screen and retain the key features in the sub-bands. Then, the image stitching module group 3 performs dimensionality reduction and feature extraction on all sub-bands to further screen and retain the key features in the sub-bands. Then, the image stitching module group 3 reconstructs all sub-bands into a complete dark-light feature map. At this time, the multi-scale illumination parameters are obtained by the image calculation process;

[0047] Step 3: The second convolutional layer 4 first convolves the dark-light image to obtain a dark-light feature map. The second image decomposition module group 5 then decomposes the dark-light feature map into multiple sub-bands of different frequencies. The second image decomposition module group 5 then performs dimensionality reduction and feature extraction on all sub-bands to screen and retain key features in the sub-bands. The image correction module group 6 then performs dimensionality reduction and feature extraction on all sub-bands to further screen and retain key features in the sub-bands. The image correction module group 6 then converts the spatial domain of all sub-bands into the frequency domain to highlight the features in the sub-bands that require dark-light restoration. The image correction module group 6 then performs brightness enhancement on the features that require dark-light restoration in all sub-bands based on multi-scale illumination parameters, and then obtains sub-bands with normal illumination information. The sub-bands are then converted from the frequency domain to the spatial domain. The image correction module group 6 then reconstructs all sub-bands into feature maps with normal brightness. The third convolutional layer 7 then performs dimensionality reduction and feature extraction on the feature maps to further increase features, and then outputs an image with normal brightness.

[0048] In the second step, the first image decomposition module group 2 includes three first image decomposition modules 21, each of which decomposes the dark-light feature map into multiple sub-bands of different frequencies, and then performs dimensionality reduction and feature extraction on all sub-bands.

[0049] In the second step, the first image decomposition module 21 includes a first attention wavelet transform module 211 and a first residual module 212. The first image decomposition module 21 decomposes the dark-light feature map into multiple sub-bands of different frequencies. The first image decomposition module 21 performs dimensionality reduction and feature extraction on all sub-bands. The first residual module 212 performs dimensionality reduction and feature extraction on all sub-bands.

[0050] In the second step, the image stitching module group 3 includes three image stitching modules 31, each image stitching module 31 performs dimensionality reduction and feature extraction on all sub-bands, and then the image stitching module 31 reconstructs all sub-bands into a complete dark-light feature map.

[0051] The image stitching module 31 includes a stitching residual module 311 and a stitching attention inverse wavelet transform module 312. The image stitching module 31 performs dimensionality reduction and feature extraction on all sub-bands. The image stitching module 31 reconstructs all sub-bands into a complete dark-light feature map. The stitching attention inverse wavelet transform module 312 reconstructs all sub-bands into a complete dark-light feature map.

[0052] In the third step, the second image decomposition module group 5 includes three second image decomposition modules 51, each of which decomposes the dark-light feature map into multiple sub-bands of different frequencies, and then performs dimensionality reduction and feature extraction on all sub-bands.

[0053] In the third step, the second image decomposition module 51 includes a second attention wavelet transform module 511 and a second residual module 512. The second image decomposition module 51 decomposes the dark-light feature map into multiple sub-bands of different frequencies. The second image decomposition module 51 performs dimensionality reduction and feature extraction on all sub-bands. The second residual module 512 performs dimensionality reduction and feature extraction on all sub-bands.

[0054] In the third step, the image correction module group 6 includes three image correction modules 61. The image correction modules 61 perform dimensionality reduction and feature extraction on all sub-bands, and then the image correction modules 61 convert the spatial domains of all sub-bands into frequency domains to highlight the features in the sub-bands that need dark light repair. The image correction modules 61 then enhance the brightness of the features in all sub-bands that need dark light repair according to the illumination parameters, and then obtain sub-bands with normal illumination information. The sub-bands are then converted from the frequency domain into the spatial domain, and then the image correction modules 61 reconstruct all sub-bands into feature maps with normal brightness.

[0055] In the third step, the image correction module 61 includes a correction residual module 611, a frequency feature transformation module 612 and a correction attention inverse wavelet transform module 613. The image correction module 61 performs dimensionality reduction and feature extraction on all sub-bands. The correction residual module 611 performs dimensionality reduction and feature extraction on all sub-bands; the image correction module 61 converts the spatial domain of all sub-bands into the frequency domain. The frequency feature transformation module 612 converts the spatial domain of all sub-bands into the frequency domain; the image correction module 61 enhances the brightness of the features that need dark light repair in all sub-bands according to the illumination parameters. The frequency feature transformation module 612 enhances the brightness of the features that need dark light repair in all sub-bands according to the illumination parameters; the image correction module 61 reconstructs all sub-bands into feature maps with normal brightness. The correction attention inverse wavelet transform module 613 reconstructs all sub-bands into feature maps with normal brightness.

[0056] In the second step, a residual connection 8 is set between the first image decomposition module group 2 and the image stitching module group 3; in the third step, a residual connection 8 is set between the second image decomposition module group 5 and the image correction module group 6.

[0057] The supplementary description of the present invention is as follows:

[0058] The effect of the present invention on dark light pictures is improved as follows: Figure 12 The signal-to-noise ratio of the present invention is 28.32, and that of the prior art is 25.63. Compared with the prior art, the signal-to-noise ratio of the present invention is improved to a certain extent, that is, the available information in the dark-light picture is improved; the structural similarity of the present invention is 0.863, and the structural similarity in the prior art is 0.822. Compared with the prior art, the structural similarity of the present invention is improved to a certain extent, that is, the structural information about the circuit board 9 carried in the dark-light picture is improved; the fault detection accuracy of the present invention is 87.33%, and that of the prior art is 85.02%. Compared with the prior art, the fault detection accuracy of the present invention is improved to a certain extent, that is, the accuracy of detection of the circuit board 9 is improved.

[0059] Example 1:

[0060] See Figure 1 — Figure 12 A method for detecting visual abnormality of a circuit board comprises the following steps:

[0061] Step 1: First, take a picture of the circuit board 9 to obtain a dark light picture;

[0062] Step 2: First, the first convolutional layer 1 convolves the dark-light image to obtain a dark-light feature map, and then starts the image calculation process. The image calculation process is as follows: the first image decomposition module group 2 decomposes the dark-light feature map into multiple sub-bands of different frequencies, and then the first image decomposition module group 2 performs dimensionality reduction and feature extraction on all sub-bands to screen and retain the key features in the sub-bands. Then, the image stitching module group 3 performs dimensionality reduction and feature extraction on all sub-bands to further screen and retain the key features in the sub-bands. Then, the image stitching module group 3 reconstructs all sub-bands into a complete dark-light feature map. At this time, the multi-scale illumination parameters are obtained by the image calculation process;

[0063] Step 3: The second convolutional layer 4 first convolves the dark-light image to obtain a dark-light feature map. The second image decomposition module group 5 then decomposes the dark-light feature map into multiple sub-bands of different frequencies. The second image decomposition module group 5 then performs dimensionality reduction and feature extraction on all sub-bands to screen and retain key features in the sub-bands. The image correction module group 6 then performs dimensionality reduction and feature extraction on all sub-bands to further screen and retain key features in the sub-bands. The image correction module group 6 then converts the spatial domain of all sub-bands into the frequency domain to highlight the features in the sub-bands that require dark-light restoration. The image correction module group 6 then performs brightness enhancement on the features that require dark-light restoration in all sub-bands based on multi-scale illumination parameters, and then obtains sub-bands with normal illumination information. The sub-bands are then converted from the frequency domain to the spatial domain. The image correction module group 6 then reconstructs all sub-bands into feature maps with normal brightness. The third convolutional layer 7 then performs dimensionality reduction and feature extraction on the feature maps to further increase features, and then outputs an image with normal brightness.

[0064] Example 2:

[0065] The basic content is the same as Example 1, except that:

[0066] See Figure 1 — Figure 5In the second step, the first image decomposition module group 2 includes three first image decomposition modules 21. Each first image decomposition module 21 decomposes the dark-light feature map into multiple sub-bands of different frequencies, and then the first image decomposition module 21 performs dimensionality reduction and feature extraction on all sub-bands. In the second step, the first image decomposition module 21 includes a first attention wavelet transform module 211 and a first residual module 212. The first image decomposition module 21 decomposes the dark-light feature map into multiple sub-bands of different frequencies. The first image decomposition module 21 performs dimensionality reduction and feature extraction on all sub-bands. The first residual module 212 performs dimensionality reduction and feature extraction on all sub-bands. In the second step, the image stitching module group 3 includes three image stitching modules 31, each of which performs dimensionality reduction and feature extraction on all sub-bands. The image stitching module 31 then performs dimensionality reduction and feature extraction on all sub-bands, and then reconstructs all sub-bands into a complete dark-light feature map. The image stitching module 31 includes a stitching residual module 311 and a stitching attention inverse wavelet transform module 312. The image stitching module 31 performs dimensionality reduction and feature extraction on all sub-bands. The image stitching module 31 reconstructs all sub-bands into a complete dark-light feature map. The image stitching module 31 includes a stitching residual module 311 and a stitching attention inverse wavelet transform module 312. The image stitching module 31 performs dimensionality reduction and feature extraction on all sub-bands. The image stitching module 31 reconstructs all sub-bands into a complete dark-light feature map.

[0067] When applied, the first first attention wavelet transform module 211 first decomposes the dark-light picture feature map into multiple sub-bands of different frequencies, and then the first first residual module 212 performs dimensionality reduction and feature extraction on all sub-bands. Then, the second first attention wavelet transform module 211 decomposes the dark-light picture feature map into multiple sub-bands of different frequencies, and then the second first residual module 212 performs dimensionality reduction and feature extraction on all sub-bands. Then, the third first attention wavelet transform module 211 decomposes the dark-light picture feature map into multiple sub-bands of different frequencies, and then the third first residual module 212 performs dimensionality reduction and feature extraction on all sub-bands. At this time, a sufficient number of sub-bands with rich frequencies can be obtained. Then, the first stitching residual module 311 performs dimensionality reduction and feature extraction on all sub-bands, and then the first stitching attention inverse wavelet transform module 312 reconstructs all sub-bands into a complete dark-light feature map. Then, the second stitching residual module 311 performs dimensionality reduction and feature extraction on all sub-bands, and then the second stitching attention inverse wavelet transform module 312 reconstructs all sub-bands into a complete dark-light feature map. Then, the third stitching residual module 311 performs dimensionality reduction and feature extraction on all sub-bands, and then the third stitching attention inverse wavelet transform module 312 reconstructs all sub-bands into a complete dark-light feature map. At this time, a large number of multi-scale illumination parameters can be obtained for use by the image correction module 61.

[0068] Example 3:

[0069] The basic content is the same as Example 1, except that:

[0070] See Figure 1 — Figure 9In the third step, the second image decomposition module group 5 includes three second image decomposition modules 51. Each second image decomposition module 51 decomposes the dark-light feature map into multiple sub-bands of different frequencies. Then, the second image decomposition module 51 performs dimensionality reduction and feature extraction on all sub-bands. In the third step, the second image decomposition module 51 includes a second attention wavelet transform module 511 and a second residual module 512. The second image decomposition module 51 decomposes the dark-light feature map into multiple sub-bands of different frequencies. The second image decomposition module 51 performs dimensionality reduction and feature extraction on all sub-bands. The second residual module 512 performs dimensionality reduction and feature extraction on all sub-bands. In the third step, the image correction module group 6 includes three image correction modules 61. The image correction modules 61 perform dimensionality reduction and feature extraction on all sub-bands, and then the image correction modules 61 convert the spatial domains of all sub-bands into frequency domains to highlight the features in the sub-bands that need dark light repair. The image correction modules 61 then enhance the brightness of the features in all sub-bands that need dark light repair according to the illumination parameters, and then obtain sub-bands with normal illumination information. The sub-bands are then converted from the frequency domain into the spatial domain, and then the image correction modules 61 reconstruct all sub-bands into feature maps with normal brightness. In the third step, the image correction module 61 includes a correction residual module 611, a frequency feature transformation module 612 and a correction attention inverse wavelet transform module 613. The image correction module 61 performs dimensionality reduction and feature extraction on all sub-bands. The correction residual module 611 performs dimensionality reduction and feature extraction on all sub-bands; the image correction module 61 converts the spatial domain of all sub-bands into the frequency domain. The frequency feature transformation module 612 converts the spatial domain of all sub-bands into the frequency domain; the image correction module 61 enhances the brightness of the features that need dark light repair in all sub-bands according to the illumination parameters. The frequency feature transformation module 612 enhances the brightness of the features that need dark light repair in all sub-bands according to the illumination parameters; the image correction module 61 reconstructs all sub-bands into feature maps with normal brightness. The correction attention inverse wavelet transform module 613 reconstructs all sub-bands into feature maps with normal brightness.

[0071] When applied, the first second attention wavelet transform module 511 first decomposes the dark light feature map into multiple sub-bands of different frequencies, and then the first second residual module 512 performs dimensionality reduction and feature extraction on all sub-bands, and then the second second attention wavelet transform module 511 decomposes the dark light feature map into multiple sub-bands of different frequencies, and then the second second residual module 512 performs dimensionality reduction and feature extraction on all sub-bands, and then the third second attention wavelet transform module 511 decomposes the dark light feature map into multiple sub-bands of different frequencies, and then the third second residual module 512 performs dimensionality reduction and feature extraction on all sub-bands; at this time, enough and rich sub-bands can be obtained; then the first corrected residual module 611 performs dimensionality reduction and feature extraction on all sub-bands, and then the first frequency feature transformation module 612 converts the spatial domain of all sub-bands into the frequency domain, and then the first frequency feature transformation module 612 performs brightness enhancement on the features that need dark light repair in all sub-bands according to the multi-scale illumination parameters, and then the first corrected attention wavelet inverse transform The conversion module 613 reconstructs all sub-bands into feature maps with normal brightness, and then the second correction residual module 611 performs dimensionality reduction and feature extraction on all sub-bands, and then the second frequency feature conversion module 612 converts the spatial domain of all sub-bands into the frequency domain, and then the second frequency feature conversion module 612 enhances the brightness of the features that need dark light repair in all sub-bands according to the multi-scale illumination parameters, and then the second correction attention inverse wavelet transform module 613 reconstructs all sub-bands into feature maps with normal brightness, and then the third correction residual module 611 performs dimensionality reduction and feature extraction on all sub-bands, and then the third frequency feature conversion module 612 converts the spatial domain of all sub-bands into the frequency domain, and then the third frequency feature conversion module 612 enhances the brightness of the features that need dark light repair in all sub-bands according to the multi-scale illumination parameters, and then the third correction attention inverse wavelet transform module 613 reconstructs all sub-bands into feature maps with normal brightness; in the above process, the obtained feature map with normal brightness gradually becomes more refined.

[0072] Example 4:

[0073] The basic content is the same as Example 1, except that:

[0074] See Figure 1 — Figure 10In the second step, a residual connection 8 is provided between the first image decomposition module group 2 and the image stitching module group 3; and in the third step, a residual connection 8 is provided between the second image decomposition module group 5 and the image correction module group 6. Preferably, the residual connection 8 provided between the first image decomposition module group 2 and the image stitching module group 3 is a residual connection 8 provided between the first residual module 212 and the stitching residual module 311, and the residual connection 8 provided between the second image decomposition module group 5 and the image correction module group 6 is a residual connection 8 provided between the second residual module 512 and the correction residual module 611.

[0075] During application, when the gradient vanishing or gradient exploding problem occurs in the splicing residual module 311, the first residual module 212 shares the subband with the splicing residual module 311 to remove the influence of the gradient vanishing or gradient exploding problem; when the gradient vanishing or gradient exploding problem occurs in the corrected residual module 611, the second residual module 512 shares the subband with the splicing residual module 311 to remove the influence of the gradient vanishing or gradient exploding problem.

[0076] Example 5:

[0077] The basic content is the same as Example 1, except that:

[0078] See Figure 1 — Figure 11 The first residual module 212, the stitching residual module 311, the second residual module 512, and the modified residual module 611 have the same structure. The first residual module 212 includes a convolution layer 101, an activation layer 102, and a convolution layer 101; the frequency transformation feature module includes a convolution layer 101, an activation layer 102, and a convolution layer 101; the PReLU function used in the activation layer 102 is:

[0079]

[0080] Where α is a constant or a parameter for adaptive adjustment.

[0081] When applied, the convolution layer 101 is used to extract features, and then the PReLU function in the activation layer 102 performs nonlinear mapping on the features, thereby improving the accuracy of brightness enhancement of the dark light restoration features; in order to prevent the overflow risk caused by excessive data when using this method, the original ReLU function is changed:

[0082]

[0083] Where α is a constant or a parameter for adaptive adjustment;

[0084] Optimized to PReLU function:

[0085]

[0086] Compared with the ReLU function, in the negative value domain, although the slope of the PReLU function is relatively small, it is a linear operation, α will not tend to zero, will not cause the Dead ReLU problem, and therefore will not cause overflow risk; α is a constant, or an adaptively adjusted parameter, so the PReLU function can update α during backpropagation to improve the accuracy of α.

[0087] The above description is only a preferred embodiment of the present invention, and the protection scope of the present invention is not limited to the above embodiment. Any equivalent modifications or changes made by ordinary technicians in this field based on the contents disclosed in the present invention should be included in the protection scope recorded in the claims.

Claims

1. A method for detecting visual abnormality of a circuit board, characterized by: The method comprises the following steps: Step 1: First, photograph the circuit board (9) to obtain a dark light picture; Step 2: First, the first convolution layer (1) convolves the dark light image to obtain a dark light feature map, and then starts the image calculation process. The image calculation process is as follows: the first image decomposition module group (2) decomposes the dark light feature map into multiple sub-bands of different frequencies, and then the first image decomposition module group (2) performs dimensionality reduction and feature extraction on all sub-bands to screen and retain key features in the sub-bands, and then the image stitching module group (3) performs dimensionality reduction and feature extraction on all sub-bands to further screen and retain key features in the sub-bands, and then the image stitching module group (3) reconstructs all sub-bands into a complete dark light feature map. At this time, the multi-scale illumination parameters are obtained by the image calculation process; Step 3: First, the second convolution layer (4) convolves the dark light image to obtain a dark light feature map, and then the second image decomposition module group (5) decomposes the dark light feature map into multiple sub-bands of different frequencies. Then, the second image decomposition module group (5) performs dimensionality reduction and feature extraction on all sub-bands to screen and retain the key features in the sub-bands. Then, the image correction module group (6) performs dimensionality reduction and feature extraction on all sub-bands to further screen and retain the key features in the sub-bands. Then, the image correction module group (6) converts the spatial domain of all sub-bands into the frequency domain to highlight the features that need dark light repair in the sub-bands. Then, the image correction module group (6) enhances the brightness of the features that need dark light repair in all sub-bands according to multi-scale illumination parameters, and then obtains sub-bands with normal illumination information. Then, the sub-bands are converted from the frequency domain to the spatial domain. Then, the image correction module group (6) reconstructs all sub-bands into feature maps with normal brightness. Then, the third convolution layer (7) performs dimensionality reduction and feature extraction on the feature maps to further increase the features, and then outputs a picture of normal brightness.

2. The method for detecting visual abnormality of a circuit board according to claim 1, wherein: In the second step, the first image decomposition module group (2) includes three first image decomposition modules (21), each of which decomposes the dark-light feature map into multiple sub-bands of different frequencies, and then the first image decomposition module (21) performs dimensionality reduction and feature extraction on all sub-bands.

3. The method for detecting visual abnormality of a circuit board according to claim 2, wherein: In the second step, the first image decomposition module (21) includes a first attention wavelet transform module (211) and a first residual module (212), and the first image decomposition module (21) decomposes the dark-light feature map into multiple sub-bands of different frequencies. The first image decomposition module (21) performs dimensionality reduction and feature extraction on all sub-bands, and the first residual module (212) performs dimensionality reduction and feature extraction on all sub-bands.

4. The method for detecting visual abnormality of a circuit board according to claim 3, wherein: In the second step, the image stitching module group (3) includes three image stitching modules (31), each image stitching module (31) performs dimensionality reduction and feature extraction on all sub-bands, and then the image stitching module (31) performs dimensionality reduction and feature extraction on all sub-bands, and then the image stitching module (31) reconstructs all sub-bands into a complete dark-light feature map.

5. The method for detecting visual abnormality of a circuit board according to claim 4, wherein: The image stitching module (31) includes a stitching residual module (311) and a stitching attention inverse wavelet transform module (312). The image stitching module (31) performs dimensionality reduction and feature extraction on all sub-bands. The image stitching module (31) reconstructs all sub-bands into a complete dark-light feature map. The stitching attention inverse wavelet transform module (312) reconstructs all sub-bands into a complete dark-light feature map.

6. The method for detecting visual abnormality of a circuit board according to claim 1, wherein: In the third step, the second image decomposition module group (5) includes three second image decomposition modules (51), each of which decomposes the dark-light feature map into multiple sub-bands of different frequencies, and then the second image decomposition module (51) performs dimensionality reduction and feature extraction on all sub-bands.

7. The method for detecting visual abnormality of a circuit board according to claim 6, wherein: In the third step, the second image decomposition module (51) includes a second attention wavelet transform module (511) and a second residual module (512). The second image decomposition module (51) decomposes the dark-light feature map into multiple sub-bands of different frequencies. The second image decomposition module (51) performs dimensionality reduction and feature extraction on all sub-bands. The second residual module (512) performs dimensionality reduction and feature extraction on all sub-bands.

8. The method for detecting visual abnormality of a circuit board according to claim 7, wherein: In the third step, the image correction module group (6) includes three image correction modules (61), and the image correction modules (61) perform dimensionality reduction and feature extraction on all sub-bands. Then, the image correction modules (61) convert the spatial domains of all sub-bands into the frequency domain to highlight the features in the sub-bands that need dark light repair. Then, the image correction modules (61) enhance the brightness of the features in all sub-bands that need dark light repair according to the illumination parameters, and then obtain sub-bands with normal illumination information. Then, the sub-bands are converted from the frequency domain into the spatial domain, and then, the image correction modules (61) reconstruct all sub-bands into feature maps with normal brightness.

9. The method for detecting visual abnormality of a circuit board according to claim 8, wherein: In the third step, the image correction module (61) includes a correction residual module (611), a frequency feature conversion module (612) and a correction attention inverse wavelet transform module (613). The image correction module (61) performs dimensionality reduction and feature extraction on all sub-bands. The correction residual module (611) performs dimensionality reduction and feature extraction on all sub-bands. The image correction module (61) converts the spatial domain of all sub-bands into the frequency domain. The frequency feature conversion module (612) converts the spatial domain of all sub-bands into the frequency domain. The image correction module (61) enhances the brightness of features that need dark light repair in all sub-bands according to illumination parameters. The frequency feature conversion module (612) enhances the brightness of features that need dark light repair in all sub-bands according to illumination parameters. The image correction module (61) reconstructs all sub-bands into feature maps with normal brightness. The correction attention inverse wavelet transform module (613) reconstructs all sub-bands into feature maps with normal brightness.

10. The method for detecting visual abnormality of a circuit board according to claim 1, wherein: In the second step, a residual connection (8) is provided between the first image decomposition module group (2) and the image stitching module group (3); and in the third step, a residual connection (8) is provided between the second image decomposition module group (5) and the image correction module group (6).

Citation Information

Patent Citations

  • Defect detection method for parameter optimization based on space particle automatic attraction algorithm

    CN113689427A

  • Method for image processing and video compression

    US20180240221A1