Research on Underwater Robot Recognition

The underwater robot fish needs to keep shaking the tail fin to move, but the wave of the water is very difficult to be predicted, in which the robot fish will show different shape. This paper proposes to use of Histogram of Oriented Gradient method for image feature extraction, and then use the genetic algorithm method to optimize the parameters of the support vector machine. We use the parameters optimized for the classification training of experimental images to recognition the robot fish.


Introduction
Support vector machine (SVM) belongs to the machine learning.It is a classifier for finding the maximum interval classification.It has a good effect in solving nonlinear and high-dimensional pattern recognition problems 1 .Over the past few years, its importance is growing.In the use of the classifier, its performance depends on the choice of the kernel function and its parameters.In this paper, the genetic algorithm is used to optimize the parameters.

Image normalization
The purpose of the normalization to image is to give the detector more robustness to illumination as the primary factor affecting the image.

Calculation of the gradient of the target image
Calculating the gradient of the target needs to be applied to the first-order differential theory, because this processing can be applied to the grayscale graphics to form a more satisfactory effect.The calculation is as follows: In order to calculate the image gradient and gradient direction better, we need to use the gradient template to calculate both the gradient of the vertical component and horizontal component 2 .The gradient template is [-1, 0, 1].The horizontal and vertical components of the gradient can be obtained as follows.

P -152
By the horizontal gradient component and the vertical gradient component as shown in the above expression, we can get the size of the gradient (that is, the gradient intensity), as well as the direction of the gradient, that is, the above-mentioned amplitude (magnitude) and angle (theta) values.
As shown in the above equation, the edge strength is affected by the sum of the gradients of the x-direction and the y-direction, and the angle is derived from tan-1 of its ratio.According to the simplification rule proposed above, the gradient intensity formula above-mentioned can be simplified as follows The angle of the gradient is given by the following equation: theta(x, y) = theta( , ) + π theta(x, y) < 0 theta( , ) others A weighted projection is used in the direction of the gradient.
The goal of this step is to project the values of the pixels in the block in the gradient direction of the image.After the projection, a horizontal axis is obtained, and the histograms of our cells are aligned along this axis.With the horizontal axis, we can compute the Histogram of Oriented Gradient of all the cells in each block, and then create a histogram at each gradient angle, placing several gradient angles above the horizontal axis.There are a variety of ways to project in a gradient, not just one.But in general, the user uses a weight projection function to solve this problem.The eigenvectors of the directional gradient histograms are normalized.At the last of this step, we need to normalize each block.
Gradient direction histogram is a very representative feature extraction method, since the emergence of this method has been shown a very powerful function in a variety of areas.Fig. 1 is the basic process of HOG.

Using genetic algorithms to select and optimize SVM parameters
The genetic algorithm based on model theory, applied by Professor Holland, is used most commonly so far.The general formula for the model theory is as follows 3 : Where H is the code of the pattern 4 , t is chromosome algebra, m(H, t) is the t-generation chromosome number of strings, pc is the exchange probability, ( is the average fitness of the H-mode in t generation, ̅ is the overall fitness, at last is the probability of mutation.Fig. 2 gives the flow chart of GA optimization to the SVM parameters.
Fig. 2 Flow chart of GA to optimize SVM parameters

Support vector machine
The main idea of machine learning is: there is a certain unknown dependency between the variable y and input x, which can also be understood as the variable y and input x follows an unknown joint probability F(x, y).Machine learning is based on n independent identically distributed observation samples (x1, y1), (x2, y2), … , (xn, yn) .Then an optimal function f (x, ω * ) is obtained from a set of functions {f (x, ω)}.This optimal function can make the expected risk function R( ) = ∫ ( , ( , ( P -153 have the minimum value.Here, {f ( , )} is a set of prediction function.Since ω ∈ Ω is a generalized function parameter, theoretically {f ( , )} can refer to any set of functions.And L ( , f ( , )) is the loss to predict variable y by using the set of predicting functions {f (x, ω)}.
The output of the function is the codename of the sorted category.The binary output function of the problem can be simply defined as a binary function y = (−1,1).With the output function, we need the loss of function output function of the forecast will result in the loss function.
L , f( , The support vector machine training in this experiment will be completed by the SVM toolbox in MATLAB.For feature extraction of training image, image itself can provide accurate pixel.However, the amount of training pixel data will cause delay the experimental speed, so the application of the direction of the image gradient as a feature extraction.

Opencv for reflective compensation
In this part, we use Opencv to the image of experimental site.Experiments were taken from different periods of the experimental site of the reflective picture 5 , and the obtained picture is subjected to hue saturation adjustment, get a more pure color and exposure of the image.Subsequently, the image is subjected to a grayscale operation, after all the Opencv functions have been processed, the compensation results are shown in the following Fig. 3 are obtained 6 .Fig. 3 Before (left) and after (right) reflective compensation

Default parameters to recognize the robot fish
The recognition experiment of the underwater robot fish begins with the method of the basic support vector set.
That is, it does not use any optimization means to predict and classify.
Prepare the appropriate training samples and determine the classification of labels after the start of training, the support vector machine parameters c and g were selected for the two groups to comparative experiment.
After obtaining the training result, we use several pictures to call the recognition function to classify and predict.After the prediction, we count the number of successful training samples and the number of failed samples to calculate the correctness of recognition as follows Table 1: Table1 Standard SVM classification results SVM parameter c=1, g=10 c=0.5, g=0.6 accuracy 50% 52% It can be seen that the parameters of SVM in the experiment are determined manually, the result is limited, and the result of recognition accuracy is not very high.But this kind of training method has got certain results.

Using optimized parameters to the sample training
In order to improve the accuracy of the previous SVM predictive classification experiments, the parameters of SVM are optimized by the genetic algorithm mentioned above.
First, the corresponding sample set and classification information are prepared, which includes the sample set and classification information used in the training of SVM.The parameters of SVM are optimized by using the genetic algorithm parameter optimization provided by the libSVM toolbox described above.The optimized support vector machine parameters are c = 3. algorithm for the recognition of the robot fish in the water is significantly more successful.

Conclusion
The results of the SVM-trained algorithm show that the proposed algorithm outperforms the default support vector machine, in the case of hardware and experimental environment has withstood the test.
In the future, the hardware and software will be a great development prospects, a large number of the input of training sample sets will make the training of the algorithm be more comprehensive, and the classification prediction will be more accurate.

Fig. 1
Fig.1 Basic process of HOG 4 and g = 5.7.The experimental result is shown in Table2.Table2 SVM classification results with GA optimization best parameter c=0.1,g=0.4accuracy 85% These experiments can let us clearly see that, with the genetic algorithm to optimize participation, support vector machine training out of the classification P -154