用超声波实现对道路表面分类

主要原理是:利用不同表面的崎岖度(roughness)不同,导致超声波的反射波形不同。按照ENDURA的理论,平滑表面反射的波振幅大,持续时间短。随着roughness增加,振幅减小,持续时间长。分析波形数据,可以提取出很多特征(feature):窗口长度,峰值,峰值位置,窗口开始位置,结束位置,等。其中,实验结果是:表示窗口长度的特征效果比较好,表示能量的特征效果较差。分类器的设计还用到了Mahalanobis距离。不过文章中给出了另一种化简Mahalanobis距离的方法:用一般化(normalized)的特征值来计算欧几里得距离。

通过识别表面类型,机器人可以判断自己目前所处环境,道路,或者用于地标导航(landmark navigation)

实验环境: MacOS LabVIEW 8.6

详细内容参考 Phillip J. McKerrow Classifying Surface roughness with CTFM ultrasonic sensing。

--------------------------------------------------------------------------------------------------------------------------------

Introduction and Background

Classifying the surfaces of road is important to robots. By doing that, a robot can know its surrounds, for example detecting carpet means robots may travel in a room. More over, we can navigate a mobile robot by using different road surfaces, for example if a robot wants to travel from a garden to a bedroom, the road surfaces it will experience are grass(garden), brick(yard), wood(sitting room), and carpet(bedroom) sequentially.

To classify different surfaces, we can take the advantage of the roughness of surfaces and the reflection of ultrasonic wave. Surface roughness is caused by small variations in surface depth [1]. For some surfaces, the roughness are periodically varied, then we can use the geometric model the describe them. In contrast, for some randomly varied surface roughness, statistical models are the only choice.

When projecting the ultrasonic wave to a surface, energy will be reflected back. According to ENDURA method, the amplitude and duration of the echo is different from different surfaces. Specifically, smooth surface gives the echo with high amplitude and short duration. When increasing the roughness, the amplitude of echo declines while the duration of echo increases. In this case, an ultrasonic sensor with high sampling speed is pointed to the surface to measure the amplitude and duration.

In this experiment, I extract features from different echo, find the best feature combination that can classify different surfaces efficiently, and then build a classifier using the feature combination.

The features to be extracted are:

1.      Window length

2.      Window start position

3.      window end position

4.      Peak position

5.      Peak position in window

6.      Peak value

7.      First element in array

There are 64 echoes in a data file. Therefore, the data file can be divided into 64 parts. In each part, the start echo is window start position and the end echo is window end position. The width of the window is window length. The position that echo peak is peak position and the amplitude is peak value.

Approach explainedPattern Recognition

Pattern classification is the task of giving names to objects based on measurements [2]. We firstly measure a set of data from an object and the combination of the set of data is called a vector.

v= [v1…vn]T

Each vector corresponds to a point in the n-dimensional feature space. For the points (or vectors) measured from one kind of object, they are located in a special area in feature space. If in a feature space, there is no overlap among all the areas of different kinds of objects and each area keeps a certain distance from other areas, then we can say that the surfaces can be classified in the feature space and the features have enough power to discriminate between the objects. Therefore, the problem is how to find a combination of features that have enough power to discriminate all the objects. To solve this problem, we extract features from training data and try all the combinations of features till we find the feature combination we need. It is obvious that the feature combination should be not too complex. In other words, we should use less features to reduce the computational complexity and make sure that our goal can be reached.

Mahalanobis distance

For a vector x=(x1,x2,x3,,,xn)T , the mean of x is μ=(μ123,,,μn)T and covariance matrix is S, Mahalanobis distance is defined as:

The values on the diagonal of the matrix are the standard deviation of features.

The values off the diagonal of the matrix are the co variances between two features. If they are zero, it means that there is no correlation between all the features which construct the feature space.

If the covariance matrix is the identity matrix, the Mahalanobis distance reduces to the Euclidean distance.

JustificationMahalanobis distance

When the variances are 1, and the co variances are 0, the co variances become identity matrix and the Mahalanobis distance becomes Euclidian distance. To reduce the Mahalanobis distance to Euclidian distance, we normalize the feature values by dividing them by their standard deviations. The division result in the new set of feature vectors all with a standard deviation of σ=1.

The Mahalanobis distance (or Euclidian distance of the normalized vectors) gives us the measure of the quality of the feature set for classification. As the unit of distance is the standard deviation of the set of measurements in the reference cluster, the distance tells us the probability of a new measurement being from that surface. 68.27% of values are within 1σof the mean vector, 95.45% within 2σ, 99.73% within 3σ. So when comparing the measurement vector to a set of mean vectors the Mahalanobis distance tells us which surface the measurement is closest to and the probability that the echo is from that surface. In this experiment, if the Euclidian disntance is greater than 6σ(σ=1), we can say the feature can discriminate two surfaces.

Advantages

Reducing Mahalanobis distance to Euclidian distance can reduce the complexity of calculation but not affect the classification accuracy.

Classification processProcess of building a classifier

1.      Extract features from each training data

2.      Calculate the average and standard deviation for each feature.

3.      Calculate the Mahalanobis distances between feature values by calculating the Euclidean distance of the normalized features.

4.      For each feature, calculate the distance between two surfaces.

5.      Calculate the amount of distances greater than 6

6.      Find the feature combination that can classify all the features.

Process of classifying

1.      Choose a set of features that have the best performance on classifying the surfaces to construct the feature space.

2.      Extract the feature values from the testing echo data.

3.      Calculate the average and standard deviation for each feature in the feature set.

4.      Calculate the Mahalanobis distances between testing echo data and all the standard echo data by calculating the Euclidean distance of the normalized features.

5.      The testing data should belong to the class that keeps the smallest distance to the testing data.

Comparative analysis

In the paper, the author mentioned that: 1 the highest quality features (the range of reflection angles and end angle) are a direct function of the roughness; 2 most of the features relating to the location and amplitude of two peaks are poor.

In my experiment, I did not extract the range of reflection angles and end angles, but the window start and window end which is related to the two features (the range of reflection angles and end angle) is used in my experiment. The final result of my experiment showed that the window start and window end are high quality features which is the same to the first point of author. However, the peak position and peak value have mid-level power, they are not so poor.

Reasons

The performance of peak position and peak value is not so poor in my experiment. The reason maybe that the performance of the two features on different sets of surfaces are different. In my experiment, the values of peak position of carpet cross and toilet tiles1 are greater than 400 while that of others are less than 40. Therefore, we can infer that the two features have good discriminate power on specific surfaces.

Analysis of colleted data

We can see from table 1, peak position in window and first element in array are poor features because they hardly vary. Because the window lengths for all the surfaces are small, therefore, the peak position in window can not vary obviously. Other features can get very high or low values on some surfaces. For example, the peak position of carpet cross and toilet tile1 were much higher than that of other surfaces; the window start of metal plate is the maximum value while that of ramp is the minimum value among all the surfaces. More over, to get the recognition rate of the features, we need to calculate the distances for each feature between two surfaces (table 2-8).

Table 9 shows the amount of the distances greater than 6σin table 2 to table 8. The total distance amount is 196(14*14). This table proved that peak position in window and first element in array are poor features, because the amount is 0. In contrast, window start and window end are the best two features, however, the recognition rate are 87.75% and 84.69% which are still lower than 92.85% (92.85% means the feature can classify all the surfaces. (196-14)/196=92.85%).

Therefore, to achieve a recognition rate of 92.85%, we should combine two features (or more) together. Table 10 shows the Euclidean distances of combining window start and window end. However, because there exists the “Inf” and “”, the classifier built using the two features can not discriminate the corresponding surfaces.

Evaluation of classifier

My classifier can make correct decision on bit, concrete path, concrete tile, concrete tiles2, grass, large slabs, lino, metal plate, ramp, rough brick, toilet tiles1, toilet tiles2. It cannot classify the carpet cross and carpet long because the feature values of the two surfaces are “inf” and “nan”. In this case, the classifier cannot get the accurate distance value to classify surfaces.

Research findings

In the research paper, the author used 5D vector composed of features: end angle, range of angle, sum of amplitudes, energy distribution and position of peak 1 or amplitude of peak1 or distance between peaks to achieve all the distances greater than 6σand hence a recognition rate of 99.73%. The author pointed that the highest quality features are based on range (angle) values not on amplitude (energy) values, which is consistent with the understanding of ultrasonic sensing.

Conclusions

Both of the author’s point and my experiment show that the features based on range values such as start angle, end angle, range of angle, window start, window end, are in high quality. The Mahalanobis distance provides both a measure of the quality of the features and a robust method for classifying surfaces with those features [3].

Future work

In future, I will try to find the reason Inf and and find the solution of avoiding them.

User manual

The program comprises four vis. The PSD.vi, FindFirstWindow.vi remains unchanged. DataFileReader.vi reads the echo file, extracts features, and normalizes feature values. The CalculateTable1-2.vi analyses the normalized features, classify the testing data.

How to use:

1.      Open CalculateTable1-2.vi in labview.

2.      Change the file path of training data.

3.      Input the testing data file path.

4.       Run the program

Result

1.      The Result field shows which class the testing data is should belong to.

2.      The “TestingEDistanceArray” shows the distance between testing data and standard data.

3.      The “Feature array” shows the feature values of all the standard surfaces.

4.      The “>Amount” shows: for each feature, the number of distances which are greater than 6

5.      The “MDistanceArray” shows the distance between two surfaces for each feature.

6.      In “Feature1,2, field, user can choose the feature combination to be tested.

7.      The “EDistanceArray” shows the distance between two surfaces for the feature combination.

原文地址:https://www.cnblogs.com/cc299/p/4792803.html