MPO surface restoration system based on optimized BP neural network

文档序号:9228 发布日期:2021-09-17 浏览:32次 中文

1. The invention relates to an MPO surface restoration system based on an optimized BP neural network, which is characterized in that a feature extraction function is utilized to perform dimension reduction processing on training sample data; optimizing the threshold and the weight of the BP neural network by adopting a genetic algorithm; and processing the height value corresponding to the noise pixel point by using a dynamic Gaussian weighted mean filtering algorithm.

2. The feature extraction function of claim 1, wherein: extracting the maximum value in the interference data of the pixel points as the first characteristic of the data; sequencing interference data of the pixel points in an ascending order, and taking the mean value of the data with the ten percent removed as a second characteristic of the data; extracting a local peak point of the interference data as new data, and solving the mean value of the new data as a third feature of the data; extracting a local peak point of the interference data as new data, subtracting the mean value of the new data from the new data, applying cubic spline interpolation to the data with the mean value subtracted, performing curve fitting on the interpolated data, taking the maximum value position of the fitted curve as a symmetry axis, calculating the area enclosed by curves on two sides of the symmetry axis and an x axis, and taking the product of the absolute value of the difference between the area ratio of the two sides and 1 and an integer n (n is 250) as a fourth characteristic.

3. The genetic algorithm optimizing thresholds and weights for a BP neural network according to claim 1, wherein: and optimizing the weight and the threshold of the BP neural network through a genetic algorithm.

4. The dynamic gaussian function weighted mean filter of claim 1, wherein: and the mean value of the two-dimensional Gaussian function is 0, the height value of the noise pixel point is taken as the center of the operator matrix, the variance of the operator matrix is taken as the variance of the two-dimensional Gaussian function, and the noise point is subjected to dynamic Gaussian mean filtering according to the two-dimensional Gaussian function.

Background art:

compared with the traditional detection method, the white light vertical scanning interference technology adopts a non-contact measurement mode, has the characteristics of high measurement precision, high detection speed and the like, and is widely applied to the field of 3D measurement. The prior MPO optical fiber connector surface restoration mainly has the following problems:

the first problem is that: most MPO optical fiber connector detection systems are put into factories for use, and due to the particularity of factory production environments, some dust or other impurities can fall on the surfaces of MPO optical fiber connectors, so that the recovery precision of the MPO optical fiber connector detection systems is influenced.

The second problem is that: the traditional Gaussian filtering denoising algorithm is long in time consumption, low in denoising precision and poor in denoising effect, and cannot meet the requirement of increasing recovery precision.

The third problem is that: in the traditional BP neural network, the dimensionality of input data is equal to the dimensionality of training sample data, and the BP neural network is trained by adopting a method of randomly selecting a threshold value and a weight value, so that the training time of the BP neural network is prolonged, and the judgment precision of the BP neural network is influenced.

In order to solve the problems, the patent provides an MPO surface restoration system based on an optimized BP neural network, and a feature extraction function is adopted to reduce the dimensions of a training sample and test sample data; determining an initial weight and a threshold of the BP neural network node by using a genetic algorithm; and processing the noise pixel points by adopting dynamic Gaussian weighted mean filtering. Impurities introduced by the factory operating environment can be quickly and effectively removed, and the 3D surface restoration precision of the MPO optical fiber connector is improved.

The invention content is as follows:

the invention provides an MPO surface restoration system based on an optimized BP neural network.

Hardware system: the hardware system comprises computer, CCD camera, PZT control instrument, work platform, white light interference system, and the work platform is gone up and is carried MPO fiber connector, and the white light interference system comprises formation of image objective, reference mirror, collimater, beam splitter prism and light source, and PZT control instrument drive work platform moves forward with 60 um's stride. The work platform is loaded with the MPO fiber connector, and with the movement of the work platform, when the position of a certain area on the surface of the MPO fiber connector meets the condition of white light interference, white light interference occurs, and white light interference fringes with alternate light and shade are generated. When the working platform moves, the CCD camera shoots images and stores the images in a mobile hard disk of a computer, the storage format of the images is bmp, and the total number of times of moving the working platform is equal to the total number of the images.

(1) The measurement principle of the measurement system based on white light interference is as follows:

along with the movement of the working platform from left to right along the scanning direction, the distance from the spectroscope of the system to the surface of the MPO optical fiber connector is changed continuously, and the corresponding optical path difference change is firstly reduced to 0 and then increased. The white light source comprises light with various wavelengths, when the white light is interfered, light waves with each wavelength generate a group of interference fringes with different intervals, the horizontal axis is the moving times of the working platform, and the vertical axis is the interference light intensity. Only when the optical path difference is 0, the zero-order interference fringes of all wavelengths can be completely superposed to generate the maximum light intensity output, so that the position of the zero optical path difference is the optimal interference position.

The moving distance of the work platform carrying the MPO optical fiber connector when the work platform moves to the position with zero optical path difference is set as x, wherein x is the relative height of the MPO optical fiber connector, the height of the work platform when the work platform does not move is set as 0, delta x is the step distance of the work platform moving each time, and n is the moving times of the work platform.

x=Δx×n (1)

A software system: the software system comprises seven parts, namely reading interference image data, acquiring training sample data, extracting local peak points, extracting data characteristics, optimizing initial parameters of a BP neural network by a genetic algorithm, constructing the BP neural network to judge pixel point types, acquiring height values of normal pixel points and repairing the height values of noise points by dynamic Gaussian weighted mean filtering.

(2) The implementation process of reading interference image data is as follows:

and using MATLAB software to read and store the gray value data of the interference image in the form of pixel points according to the sequence of the image stored by the CCD camera, and storing the gray value data of each image in the MATLAB in the form of a matrix. The gray value data of the image represents the light intensity change condition when the MPO optical fiber connector surface interferes, the length-width product of the image determines the total number of image pixel points, the total number of the data in each matrix is equal to the total number of the image pixel points, and the total number of the image is the same as the total number of the matrix. And (3) creating a null matrix, wherein the total number of the pixel points is the total number of the rows of the null matrix, the total number of the images is the total number of the columns of the null matrix, and assigning the value of the stored image data matrix to the newly-created null matrix to obtain the interference data matrix of the surface area of the MPO optical fiber connector. Each area of the MPO optical fiber connector is represented by one pixel point, the set of all the pixel points represents the surface area of the whole MPO optical fiber connector, and the data of a single row of the interference data matrix represents the light intensity change condition of white light interference in a certain area of the MPO optical fiber connector.

(3) The acquisition of the training sample data is realized by the following steps:

for an interference image obtained by a measurement system, a first interference image is taken, MATLAB software is used for reading gray value data of the image, an initial gray threshold value is set, for all gray values in a gray value matrix, pixel points larger than the gray threshold value are determined as normal pixel points, pixel points smaller than or equal to the gray threshold value are determined as noise pixel points, and position information of the found noise pixel points is recorded. Extracting 1000 parts of noise data corresponding to a specific row in the interference data matrix according to the position information of the noise point, and taking the 1000 parts of data as noise point training data of a GA _ BP neural network algorithm; and extracting 1000 parts of data of the unmarked positions in the interference data matrix as training data of the normal points of the GA _ BP neural network algorithm.

(4) The specific definition of the local peak point is as follows:

the local peak point comprises a maximum point and a saddle point, and continuous interference data [ y ] of a single pixel pointi]In (i ═ 1,2,3.., M), M is the total number of pixel point interference data, and if there are n (n ═ 2,3,4.., M-1) consecutive interference data yi+1,yi+2...,yi+nSatisfy yi+n≥yi+n+1And y isi+n≤yiThen call yi+1,yi+2...,yi+nIs a maximum point; if yi+1,yi+2...,yi+nSatisfy yi+n≤yi+n+1And y isi+n≥yiThen call yi+1,yi+2...,yi+nIs a saddle point.

(5) The data feature extraction is realized by the following steps:

for the obtained training data, the column vector represents the light intensity value change of the noise pixel points, and the row vector represents the total number of the noise pixel points.

The maximum value of the local peak point data of the Nth pixel point is taken as the 1 st characteristic data of the pixel point, as shown in the formula 10,n is the number of pixels, [ y ]i]And (i-1, 2,3.. M) is the light intensity value of the local peak point, and M is the number of the local peak points.

The local peak point data of the pixel points are arranged in ascending order, and for the data after the ascending order arrangement, the average value of the data of 10 percent of the data after the ascending order arrangement is taken as the 2 nd characteristic data, [ y ]i](i ═ 0.9M,0.9M +1,0.9M +2,. M) is the intensity value of the local peak points, M is the number of local peak points,and N is the number of the pixel points.

yi=sort(yi), (3)

Extracting the mean value of the local peak point data of the pixel points as the 3 rd characteristic data, [ y ]i](i-1, 2,3.. M) is the light intensity value of the local peak point, M is the number of the local peak points,and N is the number of the pixel points.

Carrying out cubic spline interpolation on the local peak point data of the pixel points, fitting the data subjected to cubic spline interpolation by a Gaussian function shown in formula (6), wherein a is the background light intensity, b is the zero optical path difference position in the interference process, and calculating the fitting curve in the interval [ b-3 sigma, b +3 sigma ] by using a composite trapezoidal formula]The area of the inner and straight line y ═ a, is denoted by K1. Fitting the data after cubic spline interpolation into a smooth curve, and calculating the fitted curve in the interval [ b-3 sigma, b +3 sigma ] by using a compound trapezoidal formula]The area of the inner and straight line y ═ a, is denoted by K2. The ratio of the two areas is defined as the 4 th characteristic data, [ y ]i](i ═ 1,2,3.. M) is the light intensity value at the local peak point, [ x ] xi](i ═ 1,2,3.. M) is the abscissa corresponding to the local peak pointI.e. the number of times the working platform moves, M is the number of local peak points.And N is the number of the pixel points.

The four characteristic data replace the original gray value change data of each line, so that the training speed of the neural network can be effectively changed, the prediction precision is ensured, and the processing time is greatly shortened.

(6) The initial parameter implementation process of the genetic algorithm optimization BP neural network is as follows:

the genetic algorithm optimization BP neural network is characterized in that the initial weight and the threshold of the BP neural network are optimized by the genetic algorithm, so that the optimized BP neural network can better complete tasks such as classification, and the genetic algorithm optimization BP neural network is divided into three parts, namely BP neural network structure determination, genetic algorithm optimization and BP neural network prediction.

The BP neural network structure determining part determines the structure of the BP neural network according to the number of input and output parameters of the fitting function, and further determines the length of the genetic algorithm individual; optimizing the weight and the threshold of the BP neural network by using a genetic algorithm, wherein each individual in the genetic algorithm population comprises all the weights and the thresholds of one network, the individual calculates an individual fitness value through a fitness function, and the genetic algorithm finds out the individual corresponding to the optimal fitness value through selection, intersection and variation operations, namely the weight and the threshold of the BP neural network; and (3) predicting the assignment of the optimal individual obtained by the genetic algorithm to the initial weight and the threshold value of the network by the BP neural network, and predicting the output of the function after the network is trained.

The elements of the genetic algorithm optimization BP neural network comprise population initialization, fitness function, selection operation, cross operation and mutation operation. The following operations are briefly described:

I. population initialization

The individual coding method is real number coding, each individual of the population is a real number string and consists of 4 parts of input layer and hidden layer connection weight, hidden layer threshold, hidden layer and output layer connection weight and output layer threshold. The population contains all weights and thresholds of the neural network.

Fitness function

The sum of absolute values of errors between the predicted output and the expected output after the initialized BP neural network training is used as an individual fitness value, and the calculation formula is as follows:

in the formula, n is the number of nodes output by the network; y isiIs the output of the BP neural network; m isiIs the predicted output of the first node; beta is a coefficient.

Selection operation

The method adopts a roulette method, namely a selection strategy based on fitness proportion, and the selection probability eta of each individual iiIs composed of

In the formula, FiIs the fitness value of the individual i, gamma is a coefficient; n is the number of population individuals.

Cross operation

Since individuals are encoded by real numbers, the crossover operation method adopts a real number crossover method, the kth chromosome akAnd chromosome 1 a1The method of interleaving at j bits is as follows:

akj=akj(1-b)+aljb, (11)

alj=alj(1-b)+akjb, (12)

b is a random number between [0,1 ].

V. mutation operation

Selecting the mth gene a of the ith individualimThe mutation is carried out by the following method:

aim=aim+(aim-amax)*f(g)(r>0.5), (13)

aim=aim+(amin-aim)*f(g)(r≤0.5), (14)

f(g)=r2(1-g/Gmax)2, (15)

in the formula amaxIs gene aimThe upper bound of (c); a isminIs gene aimThe lower bound of (c); r is2Is a random number, g is the current iteration number; gmaxThe maximum number of evolutions; r is [0,1]]The random number of (2).

(7) The BP neural network discriminates the pixel type as follows:

a neural network is provided having an input layer of 3 neurons, an implied layer of 4 neurons, and an output layer of 1 neuron. For the genetic algorithm, the population size is 20, the iteration number is 10, the cross probability is 0.8, and the mutation probability is 0.1. And constructing the optimal network parameters obtained by the genetic algorithm into a new BP neural network. Initializing network parameters, loading the training samples after dimension reduction, and training the network. And loading the test data into a neural network, and predicting and outputting a result through the neural network.

(8) The implementation process of obtaining the height value of the normal pixel point is as follows:

for an interference data matrix, the number of matrix rows represents the total number of pixel points of the three-dimensional image, and a local peak point [ y ] of interference data of each pixel point is extractedmaxi](i 1,2,3.. M), where M is the total number of local peak points, for each imageCarrying out cubic spline interpolation on the local peak point of the prime point to obtain interpolated data of ymaxi](i ═ 1,2,3.. 10M), the abscissa x of the maximum value of the data was obtainedmax,xmaxNamely, the zero optical path difference position coordinate in the white light interference process of each pixel point is multiplied by the scanning step n (n is 60um), and the height value H of each normal pixel point of the three-dimensional image of the restored MPO optical fiber connector can be obtainedkG, wherein G is the total number of the pixel points.

(9) The implementation process of the dynamic Gaussian function mean filtering processing noise pixel point is as follows:

and for the three-dimensional image height value matrix of the MPO optical fiber connector, the three-dimensional image height value matrix consists of the height values of normal pixel points and the height values of noise pixel points, the height values of the noise pixel points are assigned to be 0, and the height values of the noise pixel points are subjected to filtering processing by adopting a dynamic Gaussian function weighted mean filtering algorithm.

Take the height value of processing a noise point as an example: taking the height value of the noise point as the center, selecting a height value matrix [ h ] with the size of V (18 multiplied by 18)i](i 1,2,3.. V), the variance σ of all height values in the selected matrix is calculated2Setting the mean value to 0, initializing a two-dimensional Gaussian functionThe (x, y) is a gaussian weight matrix β (β is 18 × 18) of the matrix V calculated corresponding to the position of the height value in the row and column of the three-dimensional image. The selected height value matrix V (V ═ 18 × 18) is multiplied by the gaussian weight matrix β (β ═ 18 × 18) to obtain a new matrix λ (λ ═ 18 × 18), and the height value of the noise point is replaced by the mean value of the matrix λ. And performing the above processing on the three-dimensional image noise point height value of the MPO optical fiber connector to obtain a relatively smooth height value matrix, and drawing by using MATLAB software to obtain the three-dimensional image of the MPO optical fiber connector.

Description of the drawings:

FIG. 1 is a physical block diagram of an MPO fiber connector according to the present invention.

Fig. 2 is a gray scale image captured by the CCD camera of the present invention.

FIG. 3 is a schematic diagram of the MPO fiber optic connector measurement system of the present invention.

FIG. 4 is a block diagram of an embodiment of the MPO fiber optic connector measurement system of the present invention.

FIG. 5 is a flowchart of an algorithm for feature extraction of training sample data according to the present invention.

FIG. 6 is a flowchart of the algorithm for optimizing BP neural network by genetic algorithm of the present invention.

FIG. 7 is a flow chart of the dynamic Gaussian function weighted mean filtering algorithm of the present invention.

FIG. 8 is a three-dimensional restored image of MPO fiber connections before and after the application of the present invention.

FIG. 9 is a flowchart of the overall algorithm of the present invention patent.

The specific implementation mode is as follows:

the invention is further explained by combining the attached drawings.

The invention relates to an MPO surface restoration system based on an optimized BP neural network, which is characterized in that noise data and correct data are selected as training samples, and a feature extraction function is utilized to perform dimension reduction processing on the training sample data; optimizing the threshold and parameters of the BP neural network by adopting a genetic algorithm, and improving the discrimination precision of the BP neural network on noise pixel points; processing the height value corresponding to the noise pixel point by using dynamic Gaussian weighted mean filtering; and obtaining a 3D surface restoration image of the MPO optical fiber connector in a factory environment.

Fig. 1 is a physical structure diagram of an MPO optical fiber connector, which is an example of a factory operating environment that may cause the surface of the MPO optical fiber connector to be contaminated by impurities, and affect the accuracy of 3D restoration of the MPO optical fiber connector.

Fig. 2 is a gray value image shot by the CCD camera of the present invention, and the black dots in the image are impurities on the surface of the MPO fiber connector, which may affect the 3D restoration of the MPO fiber connector.

FIG. 3 is a schematic diagram of a Michelson interferometer-based measurement system, wherein a light source irradiates an optical fiber connector after passing through a collimator, the optical fiber connector is inserted on a working platform, the working platform is driven to move forwards through a PZT controller, and the moving step pitch is 60 nm. The beam is split into two by the beam splitter, wherein one beam of light is directed onto the fiber connector as a target beam and the other beam of light is directed onto the reference mirror. After the reference beam and the target beam are reflected, when the optical path difference between the reference beam and the target beam is within the coherence range of the light source, interference occurs in space. After passing through the imaging objective lens, the interference fringe image is recorded by the CCD camera and stored in the mobile hard disk.

FIG. 4 is a diagram of a real object structure of a Michelson interferometer-based measurement system of the present invention, where structure 1 is a white light source generator for providing a light source for interference; the structure 2 is an MPO optical fiber connector socket which is used as a working platform for bearing an optical fiber connector; the structure 3 is a PZT controller and is used for driving the working platform to move forwards; the structure 4 is a reference mirror and is used for generating white light interference with the target light beam; the structure 5 is a beam splitter prism which is used for splitting a light beam into two parts and transmitting the two parts to a reference mirror and an optical fiber connector; the structure 6 is a CCD camera for recording the image of the interference fringe; the structure 7 is a mobile hard disk and is used for storing a scanning image of the CCD camera.

Fig. 5 is a flow chart of an algorithm for extracting the characteristics of training sample data, according to the invention, firstly training sample data is read in, a column vector of the training sample data represents the change of light intensity values of noise pixel points, and a row vector of the training sample data represents the total number of the noise pixel points. Calculating the maximum value of training sample dataAs a first feature; sorting the data in ascending order, and taking the average value of the data of the last ten percentAs a second feature; extracting local peak points of the original data as new data, and extracting the mean value of the new dataAs a third feature; subtracting the average value of the whole data from the new data, and performing curve fitting on the data after the average value is subtracted by using cubic spline interpolation to fit a curveThe maximum value position of (1) is a symmetry axis, the area enclosed by fitting curves at two sides of the symmetry axis and an x coordinate axis is calculated, and the product of the absolute value of the difference between the area ratio of the two sides and 1 and an integer n (n is 250) is usedAs a fourth feature.

FIG. 6 is a flowchart of the algorithm for optimizing BP neural network by genetic algorithm, which is disclosed by the invention, and comprises the steps of firstly determining the number of neurons in each layer, determining the weight and threshold of the neural network by utilizing the genetic algorithm to perform selection, crossing and mutation, and constructing the optimized BP neural network.

FIG. 7 is a flowchart of the dynamic Gaussian function weighted mean filtering algorithm of the present invention, which is to calculate the variance of the matrix around the height value of a noise pixel (i.e., a dirty point), construct a two-dimensional Gaussian function according to the variance and expectations, find the weight of the matrix, perform product operation on the height value matrix around the selected noise point and a weight operator, and take the height value of the matrix after operation and the height value of the substituted noise point.

FIG. 8 is a three-dimensional restored image of MPO fiber connection before and after the application of the present invention, the visible surface raised noise is obviously weakened, the noise removing effect is better, and the 3D shape restoring effect of the MPO fiber connector is obviously improved.

FIG. 9 is a flowchart of the overall algorithm of the present invention, which is divided into a hardware system and a software system: the hardware system applies a white light interference principle, the PZT controller drives the working platform carrying the MPO optical fiber connector to move at a fixed step pitch from left to right, interference occurs when the white light interference condition is met, and the CCD camera shoots interference fringe images while the working platform moves and stores the interference fringe images in the hard disk. The software system selects noise data and correct data as training samples, and performs dimensionality reduction on the training sample data by using a feature extraction function; optimizing the threshold and parameters of the BP neural network by adopting a genetic algorithm, and improving the discrimination precision of the BP neural network on noise pixel points; processing the height value corresponding to the noise pixel point by using dynamic Gaussian weighted mean filtering; and obtaining a 3D surface restoration image of the MPO optical fiber connector in a factory environment.

完整详细技术资料下载
上一篇:石墨接头机器人自动装卡簧、装栓机
下一篇:点云图修补方法、装置、电子设备和存储介质

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!