CN115496945A - PCB true and false point identification and interpretable method based on normalized convolution attention mechanism - Google Patents

PCB true and false point identification and interpretable method based on normalized convolution attention mechanism Download PDF

Info

Publication number
CN115496945A
CN115496945A CN202211137464.8A CN202211137464A CN115496945A CN 115496945 A CN115496945 A CN 115496945A CN 202211137464 A CN202211137464 A CN 202211137464A CN 115496945 A CN115496945 A CN 115496945A
Authority
CN
China
Prior art keywords
pcb
model
true
false
neural network
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.)
Granted
Application number
CN202211137464.8A
Other languages
Chinese (zh)
Other versions
CN115496945B (en
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.)
Guangdong Jusen Intelligent Equipment Co ltd
Original Assignee
Guangdong Jusen Intelligent Equipment Co ltd
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 Guangdong Jusen Intelligent Equipment Co ltd filed Critical Guangdong Jusen Intelligent Equipment Co ltd
Priority to CN202211137464.8A priority Critical patent/CN115496945B/en
Publication of CN115496945A publication Critical patent/CN115496945A/en
Application granted granted Critical
Publication of CN115496945B publication Critical patent/CN115496945B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/764Arrangements for image or video recognition or understanding using pattern recognition or machine learning using classification, e.g. of video objects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • G06T7/0004Industrial image inspection
    • G06T7/0008Industrial image inspection checking presence/absence
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/77Processing image or video features in feature spaces; using data integration or data reduction, e.g. principal component analysis [PCA] or independent component analysis [ICA] or self-organising maps [SOM]; Blind source separation
    • G06V10/774Generating sets of training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/82Arrangements for image or video recognition or understanding using pattern recognition or machine learning using neural networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20081Training; Learning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20084Artificial neural networks [ANN]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30108Industrial image inspection
    • G06T2207/30141Printed circuit board [PCB]
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/30Computing systems specially adapted for manufacturing

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Evolutionary Computation (AREA)
  • Artificial Intelligence (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Computing Systems (AREA)
  • Software Systems (AREA)
  • Multimedia (AREA)
  • Medical Informatics (AREA)
  • Databases & Information Systems (AREA)
  • Biophysics (AREA)
  • Mathematical Physics (AREA)
  • General Engineering & Computer Science (AREA)
  • Molecular Biology (AREA)
  • Quality & Reliability (AREA)
  • Data Mining & Analysis (AREA)
  • Computational Linguistics (AREA)
  • Biomedical Technology (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Image Analysis (AREA)

Abstract

The invention relates to the field of image analysis of printed circuit boards and the technical field of deep learning, in particular to a PCB true and false point identification and interpretable method based on a normalized convolution attention mechanism. A PCB true and false point identification and interpretable method based on a normalized convolution attention mechanism comprises the following steps: a data acquisition step: preprocessing a PCB (printed Circuit Board) true and false defect map data set, and dividing the preprocessed data set into a training data set and a testing data set; a model construction step: and constructing a PCB identification and interpretable neural network model based on a normalized convolution attention mechanism. The PCB true and false point identification and interpretable method based on the normalized convolution attention mechanism can effectively identify acceptable PCB boards in a large number of defective circuit boards, gives reason explanation for model discrimination, improves the accuracy of identifying PCBs with false defects, and solves the problems of low PCB defect identification accuracy and high false defect misjudgment rate.

Description

PCB true and false point identification and interpretable method based on normalized convolution attention mechanism
Technical Field
The invention relates to the field of image analysis of printed circuit boards and the technical field of deep learning, in particular to a PCB true and false point identification and interpretable method based on a normalized convolution attention mechanism.
Background
In the defect detection of the conventional PCB industry, the defect PCB circuit boards are excluded by the defect detection of the machine through the conventional image processing technology, and a large number of PCB circuit boards having only a small number of acceptable defects are also excluded. In order to screen acceptable circuit boards from the PCB boards detected as defective by the machine, manual identification processing is often required, which is very inefficient. This undoubtedly increases the workload, further reduces the production efficiency, and may also cause misdiagnosis and missed diagnosis.
Due to the rapid development of deep learning and the emergence of a large number of PCB data sets, the PCB defect image recognition through the deep learning becomes a feasible method, and the problems are solved to a great extent. The most commonly used contemporary convolutional neural networks. The deeper the neural network is, the higher the recognition rate of the network is, and thus, increasing the depth of the neural network can improve the accuracy of PCB defect detection. However, the prediction capability of the neural network is still very limited, as the depth of the neural network increases, the network is harder to train, gradient disappearance, gradient explosion or degradation problems may occur, and the traditional convolutional neural network also has the problem of low image recognition accuracy when facing complex and various PCB defect images.
Disclosure of Invention
Aiming at the problems brought forward by the background technology, the invention aims to provide a PCB true and false point identification and interpretable method based on a normalized convolution attention mechanism, which can effectively identify acceptable PCB circuit boards in a large number of defective circuit boards, give reason explanation for model discrimination, improve the accuracy of identifying PCBs with false defects, and solve the problems of lower PCB defect identification accuracy and higher false defect misjudgment rate caused by the problems of gradient disappearance and gradient explosion possibly occurring in a deep convolution neural network.
Another objective of the present invention is to provide an identification system, which can be applied to defect detection in the PCB industry, effectively control quality anomaly, and reduce labor cost.
Another object of the present invention is to provide a computer readable storage medium, which stores a program for identifying and interpreting PCB true and false points based on normalized convolutional attention mechanism, wherein the program, when executed by a processor, implements the steps of the method.
In order to achieve the purpose, the invention adopts the following technical scheme:
a PCB true and false point identification and interpretable method based on a normalized convolution attention mechanism comprises the following steps:
a data acquisition step: preprocessing a PCB (printed circuit board) true and false defect map data set, and dividing the preprocessed data set into a training data set and a testing data set;
a model construction step: constructing a PCB identification and interpretable neural network model based on a normalized convolution attention mechanism;
model training: setting the hyper-parameters of the obtained neural network model;
leading the marked training data set into a neural network model with well-set hyper-parameters for training and learning, and training the model by adopting a random gradient descent algorithm and a Gaussian-like distribution loss algorithm;
the method comprises the steps that a classification prediction result is output by a model during operation, a standardized feature map corresponding to PCB true and false classification defects is generated, the reason for judging a single sample, namely judgment logic explanation, is given after the standardized feature map is compared, the neural network is manually adjusted through the accuracy of the judgment logic explanation to optimize the model again, and after the model is sufficiently converged, a model structure and weight parameters are derived to obtain a trained neural network model;
and (3) data testing: and (3) identifying and testing the PCB true and false point data in the test data set by using a neural network model to obtain a final true and false point classification result and self-explanation output of each judgment.
In a further description, in the model building step, the convolutional layer of the neural network model includes a top-down multi-attention mechanism module, a feature normalization module and a contrast interpretation module, and includes the following steps:
generating a sample composite feature map containing a plurality of key local features based on the multi-attention mechanism module;
generating a normalized feature map of the sample based on the feature normalization module, wherein the normalized feature map comprises a sample standard feature map and a cumulative average feature map;
and comparing the sample standard characteristic diagram with the accumulated average characteristic diagram based on the comparison and interpretation module to judge the category and give a model judgment reason.
Further, the multi-attention mechanism module is composed of multi-channel step-by-step attention convolution layers, each step-by-step attention convolution layer comprises a BN layer, a Relu layer and a three-dimensional convolution layer, with the improvement of attention, convolution kernels respectively comprise 1 × 1 to 2 × 2 to 3 × 3, a picture is divided into a plurality of attention feature map channels, distance limitation exists among the channels, each channel respectively extracts key local features of different parts, and finally peak values of feature maps of the channels are weighted and combined to obtain a sample comprehensive feature map containing the key local features.
Further, the feature normalization module is located at an output layer of the feature map, and the feature normalization module comprises a two-dimensional cross-correlation layer, a BN layer and a Relu layer, and can perform normalization alignment on the obtained sample comprehensive feature map to obtain and output a sample standard feature map with a standard pose and an accumulated average feature map;
the two-dimensional cross-correlation algorithm formula comprises the following steps:
Figure BDA0003852709910000031
wherein f is the input feature map, f (x, y) is each point in the input feature map, t is the template map which is operated by cross-correlation with the input feature map,
Figure BDA0003852709910000032
refers to the average value of the template map,
Figure BDA0003852709910000033
the average value of the corresponding parts of the input characteristic diagram and the template diagram is indicated, and u and v indicate the moving units of the template diagram on the x axis and the y axis.
Further, the contrast interpretation module comprises a cross contrast layer, a Flatten layer, a 3-layer fully-connected layer, a Softmax layer and an interpretable output module, wherein the 3-layer fully-connected layer is respectively an H1 containing 128 neurons, an H2 containing 100 neurons and an H3 containing 10 neurons, the output layer of the discrimination result is the Softmax layer, and the interpretation result output layer is a self-defined expert system interpreter.
Further, in the model training step, the neural network model performs gradient descent through a gaussian-like distribution loss algorithm, the gaussian-like distribution loss algorithm is used for guiding the multi-attention machine model to find an accurate local key feature position, and a formula of the gaussian-like distribution loss algorithm is as follows:
Figure BDA0003852709910000041
where Aexp refers to an exponential function with e as the base, (x) 0 ,y 0 ) Representing the local keypoint location, (x, y) is the current point location, σ X Standard deviation of X population, σ Y Standard deviation of Y population.
More specifically, the data acquiring step includes:
collecting a PCB real object graph with defects detected by AOI equipment, manually classifying a true defect graph and a false defect graph, marking true and false labels, and inputting the collected PCB defect graph into a pretreatment system;
and processing the PCB defect map through image expansion, corrosion and binaryzation.
Further, the model training step further includes adjusting hyper-parameters of the neural network model through multiple experiments, where the hyper-parameters include the number of hidden layers of the model, the number of selected activation functions, and the number of depth separable convolution kernels.
An identification system for executing the PCB true and false point identification and interpretable method based on the normalized convolution attention mechanism, comprising:
the data acquisition module is used for preprocessing a PCB (printed circuit board) true and false defect map data set and dividing the preprocessed data set into a training data set and a test data set;
the model building module is used for building a PCB identification and interpretable neural network model based on a normalized convolution attention mechanism;
the model training module is used for setting the hyper-parameters of the obtained neural network model; the system is also used for importing the marked training data set into a neural network model with well-set hyper-parameters for training and learning, and training the model by adopting a random gradient descent algorithm and a Gaussian-like distribution loss algorithm; the model is also used for outputting a classification prediction result during operation of the model, generating a standardized feature map corresponding to PCB true and false classification defects, comparing the standardized feature map, giving a judgment reason, namely a judgment logic explanation, for judging the reason of single sample judgment, manually adjusting the neural network to optimize the model again through the accuracy of the judgment logic explanation, storing the model after the model is sufficiently converged, and deriving a model structure and weight parameters to obtain a trained neural network model;
and the data testing module is used for identifying and testing the PCB true and false point data in the test data set by using the neural network model to obtain a final true and false point classification result and self-explanation output of each judgment.
A computer readable storage medium having stored thereon a PCB true and false point identification and interpretable method program based on normalized convolutional attention machine, which when executed by a processor implements the steps of the PCB true and false point identification and interpretable method based on normalized convolutional attention machine.
Compared with the prior art, the embodiment of the invention has the following beneficial effects:
the method can automatically generate reasonable category standard characteristic diagrams, carry out more accurate judgment and positioning according to a comparison standard characteristic diagram, and give out judgment reasons, thereby greatly improving the accuracy of PCB true and false classification and realizing the interpretability of primary model judgment. The method can effectively identify acceptable PCB circuit boards in a large number of defective circuit boards, gives an explanation of the reason for model discrimination, and can adjust and optimize the model again through the rationality of the reason for model discrimination to realize the improvement of the accuracy rate of identifying the PCB with false defects, improve the accuracy rate of PCB true and false classification, greatly reduce the labor cost required at the PCB rechecking end, greatly improve the working efficiency, solve the problems of lower PCB defect identification accuracy rate and higher false defect misjudgment rate caused by the problems of gradient disappearance and gradient explosion possibly occurring in a deep convolution neural network, realize the simple interpretability of discrimination and ensure higher output reliability of the model.
Drawings
FIG. 1 is a flow diagram of a PCB true and false point identification and interpretable method based on a normalized convolution attention mechanism according to an embodiment of the present invention;
FIG. 2 is a block diagram of a PCB identification and interpretable neural network model based on a normalized convolution attention mechanism in accordance with one embodiment of the present invention;
FIG. 3 is a block diagram of a multiple-Attention module of a PCB identification and interpretable neural network model based on a normalized convolutional Attention mechanism, according to an embodiment of the present invention;
FIG. 4 is a block diagram of a Feature Normalization Layer (Feature Normalization Layer) of a PCB recognition and interpretable neural network model based on a normalized convolution attention mechanism, according to one embodiment of the invention.
Detailed Description
Reference will now be made in detail to embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the accompanying drawings are illustrative only for the purpose of explaining the present invention, and are not to be construed as limiting the present invention.
For the purposes of this description, a "computer-readable storage medium" can be any means that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires (control method), a portable computer diskette (magnetic device), a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). Additionally, the computer-readable storage medium may even be paper or another suitable medium upon which the program is printed, as the program can be electronically captured, via for instance optical scanning of the paper or other medium, then compiled, interpreted or otherwise processed in a suitable manner if necessary, and then stored in a computer memory.
As shown in fig. 1, a PCB true and false point identification and interpretable method based on normalized convolution attention mechanism includes the following steps:
a data acquisition step: preprocessing a PCB (printed Circuit Board) true and false defect map data set, and dividing the preprocessed data set into a training data set and a testing data set;
model construction: constructing a PCB identification and interpretable neural network model based on a normalized convolution attention mechanism;
model training: setting the hyper-parameters of the obtained neural network model;
importing the marked training data set into a neural network model with set hyper-parameters for training and learning, and training the model by adopting a random gradient descent algorithm and a Gaussian-like distribution loss algorithm;
the method comprises the steps that a classification prediction result is output by a model during operation, a standardized feature map corresponding to PCB true and false classification defects is generated, the reason for judging a single sample, namely judgment logic explanation, is given after the standardized feature map is compared, the neural network is manually adjusted through the accuracy of the judgment logic explanation to optimize the model again, and after the model is sufficiently converged, a model structure and weight parameters are derived to obtain a trained neural network model;
and a data testing step: and (3) carrying out identification test on PCB true and false point data in the test data set by using a neural network model to obtain a final true and false point classification result and self-explanation output for each judgment.
The method realizes accurate defect identification and explanation of defect identification reasons for the PCB by combining a top-down multi-attention convolution neural network with a normalized feature map, and uses a neural network model to carry out identification test on PCB true and false point data in test data set to obtain a final true and false point classification result and self-explanation output for each judgment. The method can effectively identify acceptable PCB circuit boards in a large number of defective circuit boards, provides reasons for model discrimination for explanation, and can adjust and optimize the model again through the rationality of the reasons for model discrimination to realize the improvement of the accuracy rate of identifying PCB with false defects, improve the accuracy of PCB true and false classification, greatly reduce the labor cost required at the PCB rechecking end, greatly improve the working efficiency, solve the problems of lower PCB defect identification accuracy rate and higher false defect misjudgment rate caused by the problems of gradient disappearance and gradient explosion possibly occurring in a deep convolutional neural network, realize the simple interpretability of discrimination and ensure higher output credibility of the model.
Specifically, in this embodiment, the samples of the test set are input into the trained neural network model for identifying and interpretating the true and false points of the PCB, and the model outputs the judgment categories and the judgment logic interpretations of the samples, so that a higher classification and identification accuracy is achieved and the judgment interpretations can be checked to enhance the reliability of the result.
As shown in fig. 2 to fig. 4, in the model building step, the convolutional layer of the neural network model includes a top-down multi-attention mechanism module, a feature normalization module and a contrast interpretation module, and includes the following steps:
generating a sample composite feature map containing a plurality of key local features based on the multi-attention mechanism module;
generating a normalized feature map of the sample based on the feature normalization module, wherein the normalized feature map comprises a sample standard feature map and a cumulative average feature map;
and comparing the sample standard characteristic diagram with the accumulated average characteristic diagram based on the comparison and interpretation module to judge the category and give a model judgment reason.
The convolutional Layer in the neural network model mainly comprises three parts, a top-down Multi-Attention mechanism (Multi-Attention) is introduced firstly, a Feature Normalization Layer (Feature Normalization Layer) is added in a convolutional output Layer and used for generating a standardized Feature map of a sample, and finally the normalized Feature map is input into a comparison and interpretation module to output judgment and logic interpretation.
In this embodiment, the multi-attention mechanism module is composed of multi-channel step-by-step attention convolution layers, each step-by-step attention convolution layer includes a BN layer, a Relu layer, and a three-dimensional convolution layer, and as attention is increased, convolution kernels are respectively 1 × 1 to 2 × 2 to 3 × 3, a picture is divided into a plurality of attention feature map channels, distance limitation is provided between the channels, each channel extracts key local features at different positions, and finally peak values of feature maps of the channels are weighted and combined to obtain a sample comprehensive feature map including the key local features.
Specifically, the Multi-Attention mechanism (Multi-Attention) module is composed of Multi-channel step-by-step Attention convolution layers, a differentiation algorithm limit Dis (Mi) is introduced among the channels to realize that each channel can find local features of different positions, positioning to detail features is realized through iteration of three layers of Attention convolution layers, each distribution Attention convolution layer further comprises a three-dimensional convolution kernel, a Relu layer and a Resnet layer, wherein:
Dis(Mi)=∑ (x,y)∈Mi mi(x,y)[||x-t x || 2 +||y-t y || 2 ];
Figure BDA0003852709910000091
ResNet(z)=H 1 (z)+z;
wherein (t) X ,t Y ) Is the key point position of the center, (x, y) is the current key point position, z is the output of the previous layer, H 1 () Calculating by a residual convolution module;
in this embodiment, the feature normalization module is located in an output layer of the feature map, and the feature normalization module includes a two-dimensional cross-correlation layer, a BN layer, and a Relu layer, and can perform normalization alignment on the obtained sample comprehensive feature map to obtain and output a sample standard feature map and an accumulated average feature map with a standard pose;
the two-dimensional cross-correlation algorithm formula comprises the following steps:
Figure BDA0003852709910000092
wherein f is the input feature map, f (x, y) is each point in the input feature map, t is the template map which is operated by cross-correlation with the input feature map,
Figure BDA0003852709910000101
refers to the average value of the template map,
Figure BDA0003852709910000102
the average value of the corresponding parts of the input characteristic graph and the template graph is indicated, and u and v indicate the moving units of the template graph in the x axis and the y axis.
In this embodiment, the contrast interpretation module includes a cross contrast layer, a Flatten layer, a 3-layer fully-connected layer, a Softmax layer, and an interpretable output module, where the 3-layer fully-connected layer is H1 including 128 neurons, H2 including 100 neurons, and H3 including 10 neurons, respectively, the output layer of the determination result is the Softmax layer, and the interpretation result output layer is a custom expert system interpreter.
In this embodiment, the output layer of the model includes both the classification discrimination output and the interpretable output, wherein the discrimination output module is composed of three fully-connected layers, which are H1 including 128 neurons, H2 including 100 neurons, and H3 including 10 neurons, respectively, the output layer of the discrimination result is a Softmax layer, which optimizes and updates the neural network by performing random gradient descent according to a label after outputting a prediction result, and the interpretable output module is composed of a artificially defined logic expert system interpreter, which is directly interfaced with a cross-comparison layer, outputs a logic interpretation of the neural network discrimination by comparing a difference between a sample standard feature map and an accumulated average feature map, and adjusts model parameters to further optimize the neural network by providing rationality of interpretation by human judgment.
In order to improve the accuracy of PCB defect identification and guide a model to be exactly positioned at a proper defect position, the invention provides a Multi-Attention convolution mechanism (Multi-Attention) and a Feature Normalization algorithm (Feature Normalization) to be combined, a neural network mainly comprises three modules, the three modules are firstly input into a top-down Multi-Attention mechanism (Multi-Attention) module, and an obtained sample comprehensive Feature map x z Then inputting the data into a Feature Normalization Layer (Feature Normalization Layer) to obtain a sample standard Feature map x n And cumulative average profile x p And then the classification judgment result and the judgment reason explanation are output at the same time finally. Specifically, after a sample picture is convoluted, a multi-attention module is used for obtaining a feature map X [ X 'of a plurality of local features' 0 、x′ 1 、x′ 2 ...]And weighting the peak value of each characteristic diagram to obtain a sample comprehensive characteristic diagram x z Then x is added z And
Figure BDA0003852709910000111
the input feature normalization module calculates the maximum position of gamma (mu, v) according to a cross-correlation algorithm so as to carry out feature diagram self-rotation alignment to obtain x n (n is the total number of samples), and x is added n Each x in (1) i Summing to obtain cumulative average characteristic map
Figure BDA0003852709910000112
The two are simultaneously input into a comparison interpretation module to obtain accurate discrimination and discrimination logic interpretation, wherein x output each time is summed to obtain an accumulated average characteristic diagram x p The formula of (1) is as follows:
X[x′ 0 、x′ 1 、x′ 2 ...]=f(x 0 );
x z =max(X[x 0 、x 1 、x 2 ...]);
Figure BDA0003852709910000113
Figure BDA0003852709910000114
wherein f refers to multi-attention module operation, xo refers to input diagram, G refers to operation of finding the most value by rotating in a feature normalization module, and X refers to operation of finding the most value by rotating in a feature normalization module i Finger input diagram X n Each X in (1) i
According to the method, a comprehensive characteristic diagram of the sample containing important local characteristics is obtained through a multi-attention machine mechanism module, a standard characteristic diagram of the sample and an accumulated average characteristic diagram are obtained through a characteristic normalization layer, category judgment is carried out through comparison between the standard characteristic diagram and the accumulated average characteristic diagram, the reason is judged according to an interpreter, an optimization model can be adjusted according to the reason rationality, and finally the model can achieve extremely high classification accuracy and reason rationality of judgment.
In this embodiment, in the model training step, the neural network model performs gradient descent through a gaussian-like distribution loss algorithm, the gaussian-like distribution loss algorithm is used to guide the multi-attention machine model to find an accurate local key feature position, and a formula of the gaussian-like distribution loss algorithm is as follows:
Figure BDA0003852709910000115
where Aexp refers to an exponential function with e as the base, (x) 0 ,y 0 ) Representing the local keypoint location, (x, y) is the current point location, σ X Standard deviation of X population, σ Y Standard deviation of Y population.
The neural network model performs gradient descent through a loss algorithm of Gaussian-like distribution, so that each channel in the multi-attention layer can be guided to be positioned to a reasonable local effective characteristic.
Specifically, the data acquisition step includes:
collecting a PCB physical image with defects detected by AOI equipment, manually classifying real defects and false defect images in the PCB physical image, marking real and false labels, and inputting the collected PCB defect image into a preprocessing system;
and processing the PCB defect map through image expansion, corrosion and binaryzation.
The PCB defect map is processed through image expansion, corrosion and binaryzation, so that the defect characteristics of the PCB can be more obvious, the defect characteristics can be more easily distinguished, and the distinguishing accuracy is improved.
Preferably, the model training step further includes adjusting hyper-parameters of the neural network model through multiple experiments, where the hyper-parameters include the number of hidden layers of the model, the number of selected activation functions, and the number of deep separable convolution kernels.
An identification system for executing the PCB true and false point identification and interpretable method based on the normalized convolution attention mechanism, comprising:
the data acquisition module is used for preprocessing a PCB (printed circuit board) true and false defect map data set and dividing the preprocessed data set into a training data set and a test data set;
the model building module is used for building a PCB recognition and interpretable neural network model based on a normalized convolution attention mechanism;
the model training module is used for setting the hyper-parameters of the obtained neural network model; the system is also used for importing the marked training data set into a neural network model with well-set hyper-parameters for training and learning, and training the model by adopting a random gradient descent algorithm and a Gaussian-like distribution loss algorithm; the model is also used for outputting a classification prediction result during operation of the model, generating a standardized feature map corresponding to PCB true and false classification defects, comparing the standardized feature map, giving a judgment reason, namely a judgment logic explanation, for judging the reason of single sample judgment, manually adjusting the neural network to optimize the model again through the accuracy of the judgment logic explanation, storing the model after the model is sufficiently converged, and deriving a model structure and weight parameters to obtain a trained neural network model;
and the data testing module is used for identifying and testing the PCB true and false point data in the test data set by using the neural network model to obtain a final true and false point classification result and self-explanation output of each judgment.
The recognition system deeply integrates the advantages of AI artificial intelligence, and in the defect detection application of the PCB industry, through the PCBAI detection system which is independently researched and developed, the defect positioning and defect classification are carried out on the PCB, so that the quality abnormity can be effectively controlled, and the labor cost is reduced.
A computer readable storage medium having stored thereon a normalized convolutional attention based PCB true and false point identification and interpretable method program, which when executed by a processor, implements the steps of the normalized convolutional attention based PCB true and false point identification and interpretable method.
While embodiments of the present invention have been shown and described, it will be understood by those of ordinary skill in the art that: various changes, modifications, substitutions and alterations can be made to the embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the claims and their equivalents.

Claims (10)

1. A PCB true and false point identification and interpretable method based on a normalized convolution attention mechanism is characterized by comprising the following steps:
a data acquisition step: preprocessing a PCB (printed circuit board) true and false defect map data set, and dividing the preprocessed data set into a training data set and a testing data set;
a model construction step: constructing a PCB recognition and interpretable neural network model based on a normalized convolution attention mechanism;
model training: setting the hyper-parameters of the obtained neural network model;
leading the marked training data set into a neural network model with well-set hyper-parameters for training and learning, and training the model by adopting a random gradient descent algorithm and a Gaussian-like distribution loss algorithm;
the method comprises the steps that a classification prediction result is output by a model during operation, a standardized feature map corresponding to PCB true and false classification defects is generated, the reason for judging a single sample, namely judgment logic explanation, is given after the standardized feature map is compared, the neural network is manually adjusted through the accuracy of the judgment logic explanation to optimize the model again, and after the model is sufficiently converged, a model structure and weight parameters are derived to obtain a trained neural network model;
and (3) data testing: and (3) carrying out identification test on PCB true and false point data in the test data set by using a neural network model to obtain a final true and false point classification result and self-explanation output for each judgment.
2. The PCB true-false point identification and interpretable method based on the normalized convolution attention mechanism, as claimed in claim 1, wherein in the model building step, the convolution layer of the neural network model comprises a top-down multi-attention mechanism module, a feature normalization module and a comparison interpretation module, comprising the following steps:
generating a sample composite feature map containing a plurality of key local features based on the multi-attention mechanism module;
generating a normalized feature map of the sample based on the feature normalization module, wherein the normalized feature map comprises a sample standard feature map and a cumulative average feature map;
and comparing the sample standard characteristic diagram with the accumulated average characteristic diagram based on the comparison and interpretation module to judge the category and give a model judgment reason.
3. The PCB true and false point identification and interpretable method based on the normalized convolution attention mechanism is characterized in that the multi-attention mechanism module is composed of multi-channel step-by-step attention convolution layers, each step-by-step attention convolution layer comprises a BN layer, a Relu layer and a three-dimensional convolution layer, as the attention is improved, the convolution kernels are respectively 1 x 1 to 2 x 2 to 3 x 3, a picture is divided into a plurality of attention feature map channels, distance limitation is arranged among the channels, key local features of different parts are respectively extracted from each channel, and finally peak values of feature maps of the channels are weighted and combined to obtain a sample comprehensive feature map containing the key local features.
4. The PCB true and false point identification and interpretable method based on the normalized convolution attention mechanism is characterized in that the feature normalization module is positioned at an output layer of the feature map, the feature normalization module comprises a two-dimensional cross-correlation layer, a BN layer and a Relu layer, and can perform normalized alignment on the obtained sample comprehensive feature map to obtain and output a sample standard feature map with a standard pose and a cumulative average feature map;
the two-dimensional cross-correlation algorithm formula comprises the following steps:
Figure FDA0003852709900000021
wherein f is the input feature map, f (x, y) is each point in the input feature map, t is the template map which is operated by cross-correlation with the input feature map,
Figure FDA0003852709900000023
refers to the average value of the template map,
Figure FDA0003852709900000022
the average value of the corresponding parts of the input characteristic diagram and the template diagram is indicated, and u and v indicate the moving units of the template diagram on the x axis and the y axis.
5. The PCB true and false point identification and interpretable method based on the normalized convolution attention mechanism, as claimed in claim 2, wherein the contrast interpretation module comprises a cross contrast layer, a Flatten layer, a 3-layer fully-connected layer, a Softmax layer and an interpretable output module, the 3-layer fully-connected layer is H1 containing 128 neurons, H2 containing 100 neurons and H3 containing 10 neurons respectively, the output layer of the discrimination result is the Softmax layer, and the interpretation result output layer is a custom expert system interpreter.
6. The PCB true and false point identification and interpretable method based on the normalized convolution attention mechanism as claimed in claim 2, wherein in the model training step, the neural network model is subjected to gradient descent by a Gaussian-like distribution loss algorithm, the Gaussian-like distribution loss algorithm is used for guiding the multi-attention mechanism module to find an accurate local key feature position, and the formula of the Gaussian-like distribution loss algorithm is as follows:
Figure FDA0003852709900000031
where Aexp refers to an exponential function with e as the base, (x) 0 ,y 0 ) Representing the local key point position, (x, y) is the current point position, σ X Standard deviation of X population, σ Y Standard deviation of Y population.
7. The PCB true-false point identification and interpretable method based on the normalized convolution attention mechanism of claim 1, wherein the data acquiring step comprises:
collecting a PCB physical image with defects detected by AOI equipment, manually classifying real defects and false defect images in the PCB physical image, marking real and false labels, and inputting the collected PCB defect image into a preprocessing system;
and processing the PCB defect map through image expansion, corrosion and binaryzation.
8. The PCB true-false point identification and interpretable method based on the normalized convolution attention mechanism of claim 1, wherein the model training step further comprises adjusting hyper-parameters of the neural network model through a plurality of experiments, wherein the hyper-parameters comprise the number of hidden layers of the model, the selected activation function and the number of deep separable convolution kernels.
9. An identification system, characterized in that the PCB true-false point identification and interpretable method based on the normalized convolution attention mechanism is executed, as claimed in any one of claims 1 to 8, and comprises:
the data acquisition module is used for preprocessing a PCB (printed Circuit Board) true and false defect map data set and dividing the preprocessed data set into a training data set and a testing data set;
the model building module is used for building a PCB identification and interpretable neural network model based on a normalized convolution attention mechanism;
the model training module is used for setting the hyper-parameters of the obtained neural network model; the system is also used for importing the marked training data set into a neural network model with well-set hyper-parameters for training and learning, and training the model by adopting a random gradient descent algorithm and a Gaussian-like distribution loss algorithm; the model is also used for outputting a classification prediction result during operation of the model, generating a standardized feature map corresponding to PCB true and false classification defects, comparing the standardized feature map, giving a judgment reason, namely a judgment logic explanation, for judging the reason of single sample judgment, manually adjusting the neural network to optimize the model again through the accuracy of the judgment logic explanation, storing the model after the model is sufficiently converged, and deriving a model structure and weight parameters to obtain a trained neural network model;
and the data testing module is used for identifying and testing the PCB true and false point data in the test data set by using the neural network model to obtain a final true and false point classification result and self-explanation output of each judgment.
10. A computer readable storage medium, wherein the computer readable storage medium stores a PCB true and false point identification and interpretable method program based on the normalized convolutional attention machine, and when the PCB true and false point identification and interpretable method program based on the normalized convolutional attention machine is executed by a processor, the steps of the PCB true and false point identification and interpretable method based on the normalized convolutional attention machine according to any one of claims 1 to 8 are implemented.
CN202211137464.8A 2022-09-19 2022-09-19 PCB true and false point identification and interpretable method based on normalized convolution attention mechanism Active CN115496945B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211137464.8A CN115496945B (en) 2022-09-19 2022-09-19 PCB true and false point identification and interpretable method based on normalized convolution attention mechanism

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211137464.8A CN115496945B (en) 2022-09-19 2022-09-19 PCB true and false point identification and interpretable method based on normalized convolution attention mechanism

Publications (2)

Publication Number Publication Date
CN115496945A true CN115496945A (en) 2022-12-20
CN115496945B CN115496945B (en) 2023-04-18

Family

ID=84470779

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211137464.8A Active CN115496945B (en) 2022-09-19 2022-09-19 PCB true and false point identification and interpretable method based on normalized convolution attention mechanism

Country Status (1)

Country Link
CN (1) CN115496945B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116773544A (en) * 2023-06-15 2023-09-19 上海工程技术大学 Steel structure plate fault detection method and system based on deep learning

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB201305014D0 (en) * 2013-03-19 2013-05-01 Elumotion Ltd Linear actuator
CN111489334A (en) * 2020-04-02 2020-08-04 暖屋信息科技(苏州)有限公司 Defect workpiece image identification method based on convolution attention neural network
US20200292462A1 (en) * 2019-03-15 2020-09-17 Inventec (Pudong) Technology Corporation Surface defect detection system and method thereof
CN112215223A (en) * 2020-10-16 2021-01-12 清华大学 Multi-direction scene character recognition method and system based on multivariate attention mechanism
CN113112482A (en) * 2021-04-15 2021-07-13 深圳市玻尔智造科技有限公司 PCB defect detection method based on attention mechanism network
CN113379686A (en) * 2021-05-26 2021-09-10 广东炬森智能装备有限公司 PCB defect detection method and device
US20210383526A1 (en) * 2020-06-09 2021-12-09 Inventec (Pudong) Technology Corporation Method for training defect detector
CN114820569A (en) * 2022-05-19 2022-07-29 中国计量大学 PCB surface defect classification method based on improved ResNet34 network

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB201305014D0 (en) * 2013-03-19 2013-05-01 Elumotion Ltd Linear actuator
US20200292462A1 (en) * 2019-03-15 2020-09-17 Inventec (Pudong) Technology Corporation Surface defect detection system and method thereof
CN111489334A (en) * 2020-04-02 2020-08-04 暖屋信息科技(苏州)有限公司 Defect workpiece image identification method based on convolution attention neural network
US20210383526A1 (en) * 2020-06-09 2021-12-09 Inventec (Pudong) Technology Corporation Method for training defect detector
CN112215223A (en) * 2020-10-16 2021-01-12 清华大学 Multi-direction scene character recognition method and system based on multivariate attention mechanism
CN113112482A (en) * 2021-04-15 2021-07-13 深圳市玻尔智造科技有限公司 PCB defect detection method based on attention mechanism network
CN113379686A (en) * 2021-05-26 2021-09-10 广东炬森智能装备有限公司 PCB defect detection method and device
CN114820569A (en) * 2022-05-19 2022-07-29 中国计量大学 PCB surface defect classification method based on improved ResNet34 network

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
HUAN ZHANG 等: "CS-ResNet: Cost-sensitive residual convolutional neural network for PCB cosmetic defect detection" *
YICHAO LIU 等: "NAM: Normalization-based Attention Module" *
罗炳军 等: "线路板检测中自动光学聚焦系统的优化" *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116773544A (en) * 2023-06-15 2023-09-19 上海工程技术大学 Steel structure plate fault detection method and system based on deep learning
CN116773544B (en) * 2023-06-15 2024-07-26 上海工程技术大学 Steel structure plate fault detection method and system based on deep learning

Also Published As

Publication number Publication date
CN115496945B (en) 2023-04-18

Similar Documents

Publication Publication Date Title
CN110543878B (en) Pointer instrument reading identification method based on neural network
Yuan et al. Vision-based defect detection for mobile phone cover glass using deep neural networks
CN105389593B (en) Image object recognition methods based on SURF feature
CN110148162A (en) A kind of heterologous image matching method based on composition operators
CN109614488B (en) Text classification and image recognition-based distribution network live working condition judgment method
CN111539330B (en) Transformer substation digital display instrument identification method based on double-SVM multi-classifier
CN111832608A (en) Multi-abrasive-particle identification method for ferrographic image based on single-stage detection model yolov3
CN111667455A (en) AI detection method for various defects of brush
CN108932712A (en) A kind of rotor windings quality detecting system and method
CN111398291B (en) Flat enameled electromagnetic wire surface flaw detection method based on deep learning
CN115439458A (en) Industrial image defect target detection algorithm based on depth map attention
CN108764134A (en) A kind of automatic positioning of polymorphic type instrument and recognition methods suitable for crusing robot
CN112381175A (en) Circuit board identification and analysis method based on image processing
CN115496945B (en) PCB true and false point identification and interpretable method based on normalized convolution attention mechanism
CN110427943A (en) A kind of intelligent electric meter technique for partitioning based on R-CNN
CN117333948A (en) End-to-end multi-target broiler behavior identification method integrating space-time attention mechanism
CN114863189B (en) Intelligent image identification method based on big data
CN113221956A (en) Target identification method and device based on improved multi-scale depth model
CN114494103A (en) Defect detection method and device
CN111178405A (en) Similar object identification method fusing multiple neural networks
CN115019294A (en) Pointer instrument reading identification method and system
CN112561885B (en) YOLOv 4-tiny-based gate valve opening detection method
CN112132137A (en) FCN-SPP-Focal Net-based method for identifying correct direction of abstract picture image
CN116735610A (en) Steel pipe surface defect detection method based on machine vision
CN112508946B (en) Cable tunnel anomaly detection method based on antagonistic neural network

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
GR01 Patent grant
GR01 Patent grant