集中式数据采集与通讯的无线传感器网络

Download Report

Transcript 集中式数据采集与通讯的无线传感器网络

An Automatic Optical Inspection System
for the Diagnosis of Printed Circuits
Based on Neural Networks
基于神经网络的自动光学检测系统
摘要:本文提出了一种用于PCB板的诊断系统,该系统基于自动光
学检测技术,以低成本和广泛的适用性为主要特征。该系统是一个
完整的电路贴片缺陷的检测系统。为了很好的实现这种检测功能,
首先设计了一个低成本高精确性的图像获取系统。然后,通过小波
变换和神经网络对图像进行处理,通过这种处理方式可以降低运算
量并且能够保证运算的精确度。小波变换空间可以根据位置信息,
实现对有用特征的特征提取。本文通过演示该系统在不同电路中不
同缺陷的应用,来分析系统的原理及具体实现过程。
关键词:自动光学检测(Automated Optical Inspection)
小波变换(Wavelets) 神经网络(Neural Network)
PCB板(Printed Circuit Bosrds diagnosis)。
简介
PCB板的自动检测技术可以分为两类:电气接触式检测法(electrical/contact
methods)和非电气非接触式检测法(non-electrical/non-contact methods). 电气
接触式检测法的特点是:高成本,低速度,并且无法检测出非电气缺陷,如线宽过
宽或间距过小等缺陷。与此同时,非接触式方法,在速度和功能方面可以提高诊断
能力。自动光学检测(AOI)在PCB板的自动生产过程中起到了非常重要的作用。
计算机技术,图像处理,模式识别和人工智能的发展,使得电子产业中视觉检测得
到了快速的发展,设备性能提高的同时,成本却下降了,尤其是表面组装技术
(Surface Mounting Technology)发展更为迅速。传统的PCB视觉检测是由人工目
测完成的。但是人工检测速度慢、漏检率高、成品率低。一些作者提出了AOI方法,
采用了用不同的的决策器,如模糊系统(Fuzzy Systems),神经网络(Neural
Networks)或专家系统(Expert System)。这些系统不是耗时就是需要复杂的光
源系统,或需要很多的CCD 照像机,这使得图像的获取过程非常复杂。
本文提出的方法特别的简单,并且成本也很低。它只需要一个CCD
照相机,并且不需要将PCB板定位在一个精确的包含X-Y坐标轴的桌
面上。可以将PCB放在一个自动的传送线上,不需要中断生产线。
该系统的诊断过程是基于元件图像和原件缺陷图像的数据库。处理
器通过一个图形处理程序存储图像,然后系统自动训练神经网络来
识别相应的图像。训练的输入数据是小波变换的系数(WaVelet
Transform (WVT) coefficients.)。小波变换可以有效地将图像分解
为不同频率不同幅度的许多部分。因此,感兴趣的目标区域的信息
可以很容易的在对应的区域中提取出来 。
二 诊断方法 (THE DIAGNOSIS APPROACH)
诊断过程可以看成是一个模式识别系统,由元件的图像来承当
识别的模式。一个典型的模式识别系统由三个模块组成:转换
器——用来获取物理设备上的数据;特征提取器——用来减少
数据量和计算许多特征或属性;分类器——用来根据设备的状
态做出最后的判断。在文正的AOI系统中,物理设备就是PCB
板,转换器是CCD照相机,分类器是一个神经网络。该诊断系
统的目的就是实现自动的缺陷检测。诊断系统的结构如图1所示。
该系统包括两个过程:一个是对诊断的训练过程,另一个是系
统对待检测电路的诊断过程 。
A. 训练过程(Training procedure)
通过训练一组神经网络来实现对所有可能出现缺陷的元件
的诊断。每一个神经网络采用一组模式。这些模式是与待
检测元件的所有缺陷相对应的。
A set of neural networks are trained to diagnose all the
possible components. Each neural network is trained
using a set of patterns, corresponding to the defects to
be diagnosed on the corresponding component.
B. 检测过程(Testing procedure)
假如有一块待检测的PCB板,和一个CCD照相机。用照相机取得电路的图像。
该图像先经过预处理,来提取重要的特征,然后这些特征被用来作为重要的输
入,输入到一组之前已经训练过的神经网络中,由神经网络识别电路的缺陷。
神经网络的输出就是该诊断系统的诊断结果。这种产生训练模式的方法可以使
我们在进入生产线之前设置一个诊断系统,这一点是非常有用的,因为它大大
降低了诊断成本,并且可以使生长线和诊断系统同时工作。
Given a board to be diagnosed, a CCD camera acquires a circuit image. This
image is pre-processed to extract the significant features, and then it is used
as an input to the set of neural networks previously trained to recognize the
defects on that circuit. The outputs of the neural networks represent the
diagnosis of the system. The method used to create the training set allows us
to set the diagnostic system before implementing the production line. This is
very useful, because it reduces the cost of the diagnosis and allows us to start
the production line and the diagnostic system simultaneously 。
三 诊断系统的实现结构(THE DIAGNOSTIC SYSTEM
ARCHITECTURE)
诊断系统的逻辑结构方框图如图2所示。接下来,详细描述该诊断系统的
主要部分。
A. 图像获取系统 (The Image Acquisition System)
一个包含X-Y轴的定位系统用来监测所有的CCD照相机的摆放位置。通过
改变镜头的放大倍数来控制拍摄区域的边框。我们选择移动CCD照相机二
不是移动PCD板以使系统得更快更稳定,并且可以独立于生产线。为了控
制光照条件,用黑色的屏幕遮盖该图像采集系统,以屏蔽外界的光源 。
An X-Y positioning system supervises all the displacements of the CCD
camera. The dimension of the framed region is controlled by modifying
the lens zooming. Wechose to move the CCD rather than the PCBs in
order to obtain a faster and more flexible system, independent of the
production line. In this way the AOI is very useful not only in the
electronic industry but also in a wide range of applications.
In order to control the illumination conditions, the acquisition system is
covered with black screens that avoid external light sources.
B. 数据库(The Database)
该数据库为所有该诊断系统要完成的任务提供支持。该数据库用SOL语言开发,
包含了系统所需的所有知识。可以通过程序来更新数据库。可以通过用户的图
形界面或者是系统运行的过程中实时的更新数据库。
数据库中存储的主要数据就是图像。首先存储的是没有任何缺陷的光板的图像,
该图像被用来作为处理器的参考图像。此外数据库还存储了所有元件的图像及
元件可能出现的缺陷的图像。每一个元件或区域都与一个神经网络想联系,该
神经网络被用来识别相应的元件的缺陷。
A database supports all the tasks performed by the diagnostic system. Such
database, developed in SQL language, represents the knowledge of the
system. A set of procedures permits to update the database, whether directly
using a graphical interface or automatically, in real time, during the system
functioning 。
The main type of data stored in the database is the images. The golden
image has no application in the diagnosis process, but it is used as reference
image by the operator. The databank stores the images of the components
and the images of all the defects to detect. Each component or region is
associated to a neural network, which is trained to recognize the
corresponding defects that can occur 。
C. 程序 (The Procedures)
系统通过执行一组程序,实现对任务的管理。程序是在LabView的开发环境下
开发的。用户通过图形界面控制管理运算器执行程序。接下来,对主要的程序
进行解释
a) 模板匹配(Template matching)用于确定基准点
进行模板匹配用以确定基准点(fiducial points)。由程序按照实现设计好的路
径控制CCD照相机由基准点开始并依次向每一个元件移动。当搜索区域很小时,
该程序的运行速度非常快。
Template matching, devoted to identify the fiducial points in the CUT. Thanks
to this procedure the CCD camera can move on the reference point in the
CUT, and from there it can move in sequence over each component, on the
basis of the positions schedule. Such procedure demonstrated to be very fast,
especially if the searching area is small.
b) 模板匹配(Template matching)用于确定框架 (frame)
为了避免位差(parallaxes)和使图像在贴片允许的位移容限内,CCD
照相机采集到比元件覆盖区域空间略大一点的区域,然后将该区域的图
像与参考图像进行对比。
In order to avoid the parallaxes and to make the images independent
by the mounting tolerance.
Therefore, the CCD acquires an area larger than the component and
then the reference image of the component is used as template in such
area.
c) 特征提取 (Feature extraction)用于减少数据量和选择有用的诊断信息。
为了实现这个目的,测试了很多种程序,小波变换在减少数据量和保持有用特征
方面所得到的结果是最理想的。
To this purpose, different procedures have been tested. The best results have
been obtained with the Wavelets transforms [6], in term of both data reduction
and kept information.
d) 训练神经网络 (Training of the neural networks)
每次当有新的元件或新的缺陷要加入数据库时,一个包含多层感知器的神经网络
(MLP)就要被训练。训练集是通过恢复数据库中恢复一副包含所有元件及元件
的所有缺陷的图像来产生的。然后通过小波变换对图像进行预处理以提取有用的
特征信息。这一组信息就被作为神经网络的输入。在诊断阶段,当神经网络被激
活时,就要对通过小波变换后的待测图像的相同元件进行选择和比对。
神经网络的输出与可能的缺陷相联系。Sigmoidal激活函数(sigmoidal activation
function)被用来产生神经网络的输出。由于整个训练过程应该是自动的,因此确
定隐层的数量和结束训练的标准是非常重要的。可以通过增加隐层的数量以获得
理想的效果。早期的结束标准包含两个示例集:训练集和修正集。在训练的过程
中,神经网络经过训练以识别训练集,并行的,修正集也在通过计算待测图像和
参考图像的均方差(MSE)进行估值。一旦MSE开始升高,训练就中止。该方法
的目的是为了避免过度拟合。为了提高神经网络的鲁棒性(robustness),想向训
练集中增加了一些虚构模式。他们是通过向训练模式增加高斯噪声来实现的。这
并不影响世纪的图像,但提高了网络的健壮性 。
四 实验结果
图3提供了一组电子开关,用以测试该诊断系统。
图4描述的是图3中开关的实现电路
对比图4中的两幅图,其中一副是有标准的图像,一副是训练后的图像。注意到
右边的图像标签为C1的元件缺失,这就是神经网络根据输入的缺陷经过训练以后
模拟的图像,尽管该图像不同于真正的元件缺失的图像,但证明了神经网络经过
训练可以识别和诊断缺陷的功能。图5描述是标签为U1的元件的图像,右边的引
脚有焊锡的缺失。这是一个典型的不能由电气检测检测到的缺陷。在训练的过程
中,系统通过数据库中由缺陷的引脚的图像来恢复图像,并将其覆盖在没有缺陷
的光板上的相应位置处 。
在压缩数据量和保持有用特征方面,小波变换的效果是最好的,图6是对图5的图
像进行小波变换后得到的图像。图7是对图5的图像进行傅立叶变换后得到的图像。
图6中在三个方向对图像进行小波变换,从左向右依次为:水平方向,竖直方向,
对角线方向。
通过图6和图7的对比可知,图7中明显比图6中少了定位信息,元件的特征信息,如
边界信息。边界对于图像处理是非常重要的特征信息。显然小波变换比傅立叶变换
在提取有用特征方面更高效 。
Table 1. Data amount when first node, 20%, 50%, 80% and 100%
nodes die. The base station is at (0, 0), (50, 50) and (0, −87), nodes
are in 100 × 100 area. Initial energy for each node is 0.5 J.
从表中可以看出当死亡率达到一定阶段是,Bi-AntCHAIN
方法是发送数据最多的。
Fig. 6. Data amount (unit)/energy (J)/node
Fig. 7. Network lifetime (round) when dead node percentage
threshold is 20% and 50%. Sensor area is 100m∗100 m, sensor
nodes’ initial energy is 0.5 J.
2.3能量利用比较
这部分的比较是假设每个点都提供一定
的能量,当那个点死亡时,其能量利用了多
少,比较的结构如图八所示。
Fig. 10. Energy utilized by each sensor node when first node dies. The sensor nodes indexes are sorted according its
utilization. Base station is at (0, 0); initial energy is 0.5 J. left, sensor area is 100∗100m; right: sensor area is 200∗200m.
从图中可以看出,在大小不同的WSN,Bi-AntCHAIN方法的能量
利用都是最充分的。
从以上的分析可知,Bi-AntCHAIN方
法提供了最优的数据传输路径,最低的能
量消耗和最充分的能量利用。