Upload
others
View
10
Download
0
Embed Size (px)
Citation preview
Similarity Measurement Based on Trigonometric Function Distance
Zongmin Li1,2, Kunpeng Hou1, Hua Li2 1School Of Computer Science and Communication Engineering,University Of Petroleum,
Shandong China 257061 [email protected] , [email protected]
2Institute of Computing Technology,Chinese Academy of Sciences, 100080, Beijing, China [email protected]
Abstract
With the research and analysis on similarity measures which are commonly used in Cross-Media Retrieval and Content Based Image Retrieval (CBIR), a new method called Trigonometric Function Distance is proposed. This method satisfies metric properties, and is better than Euclidean Distance and Minkowski Distance in image similarity. To support this new theory, an algorithm for object shape analysis is designed, and experiments based on Trigonometric Function Distance are conducted. Experiments give an encouraging high recognition rate by using the new similarity measurement. Keywords: similarity measurement, trigonometric function distance, image retrieval. 1. Introduction
In Cross-Media Retrieval and Content Based Image Retrieval (CBIR), the similarity of two images can be measured with their eigenvectors. The commonly used similarity measurement is the geometry mode. If we take eigenvector as one point in vector space, the similarity can be measured with the distance of the two points [1] [2].
At present, similarity measurement method that commonly used in CBIR has Minkowski Distance, Euclidean Distance and Manhalanobis Distance etc…[3] [4] [5] [6] [7] [8]. And two methods more usually used are Minkowski Distance and Euclidean Distance. But in the research of image retrieval, we find some problems with them, and these problems may reduce recognition rate in image matching. In this article, we propose a new similarity measurement method, which is called Trigonometric Function Distance. This new method can normalize the distance of two points, and can be used in similarity measurement to enhance the veracity of image matching. 2. Similarity Measures
Several similarity measures are as follows [9]:
2.1 Lp Distance, Minkowski Distance
Many similarity measures on shapes are based on the Lp distance. For two points x, y in Rk, the Lp distance is defined as
pk
ip
ii yxyxDis1
0)||(),( ∑ =
−= (2.1)
This is often called the Minkowski Distance. For p = 1, we get the Manhattan Distance L1 :
∑ =−=
k
i ii yxyxDis0
||),( (2.2)
For p = 2, we get the Euclidean Distance L2:
∑=−=
k
i ii yxyxDis0
2)(),( (2.3)
For p = ∞, we get the Chebyshev Distance:
iikiyxyxDis −=
≤≤0max),(
(2.4) In CBIR, commonly used Minkowski Distance is L1,
Manhattan Distance. In order to endow element with equal power to compute the distance between two eigenvectors, we can adjust (2.2) a little bit to (2.5).
∑=
−=
k
i ii
ii
yxyx
yxDis0 |)||,min(|
||),(
(2.5) But there is a problem with (2.5). If the contrast
between xi’s magnitude and yi’s magnitude is a little bigger, the distance between xi and yi will be very large, and that will reduce the validity of similarity measurement greatly.
2.2 L2, Euclidean Distance
Euclidean Distance is one example of Minkowski
distance as r=2.
∑=−=
k
i ii yxyxDis0
2)(),( (2.6)
Euclidean Distance is the most simple distance formula. Since it answers for human feeling to images’ difference, it is used widely in CBIR. But Euclidean
2006 1st International Symposium on Pervasive Computing and Applications
227
Distance takes no account of the relationship among elements, and treats each element equally, so Euclidean Distance is dependent on the bigger element of eigenvector.
2.3 Euclidean Distance with weights
∑=−=
k
i iii yxwyxDis0
2)(),( (2.7)
Euclidean Distance with Weights considers different importance between dimensions, and meets the needs of weights adjustment. But it is difficult to choose a more accurate weight for every element in similarity measurement.
2.4 Manhalanobis Distance
)()(),( 1 yxAyxyxDis t −−= −
(2.8) Where matrix A is the covariance matrix. Manhalanobis Distance notices statistical character
of samples, and gets rid of the relativity influence between samples.
The key of Manhalanobis Distance is the calculation of covariance. When the test database is large, the calculation of covariance is time-consuming. On condition that each element in vector is independent, covariance matrix is diagonal matrix. As density distributing is even in the orientation of each element, A is an identity matrix, and then Manhalanobis Distance really turns to Euclidean Distance.
3. Descriptions of Trigonometric Function Distance
For two points x, y in R, we can define Trigonometric Function Distance as follows:
),(|))(|sin(arctan),( Ryxyxyx ∈−=ρ (3.1)
Then we can use formula (3.2) to calculate the distance between two vectors.
∑ =−=
k
i ii yxyxDis0
|))(|sin(arctan),(
(3.2)
Because the maximum value of ),( yxρ is 1, and the minimum is 0, so Trigonometric Function Distance can normalize the distance between any two points.
If we regard |x-y| as parameter, Trigonometric Function Distance can be transformed
into . )0())(sin(arctan)( ≥= xxxf
Figure 3-1 function f(x)
Table 3-1 lists the relative error between f(x) and independent variable x.
Table 3-1 relative error between f(x) and independent
variable x magnitude of x sin(arctan(x))
0.000001 0.000000999999999999499990
0.000010 0.000009999999999500000700
0.000100 0.000099999999500000007000
0.001000 0.000999999500000375200000
0.010000 0.009999500037496875100000
0.100000 0.099503719020998929000000
1.000000 0.707106781186547460000000
10.00000 0.995037190209989150000000
100.0000 0.999950003749687570000000
1000.000 0.999999500000374960000000
… … … …
magnitude of x (x-sin(arctan(x)))/x
0.000001 4.999741e-013
0.000010 4.999995e-011
0.000100 5.000000e-009
0.001000 4.999996e-007
0.010000 4.999625e-005
0.100000 4.962810e-003
1.000000 2.928932e-001
10.00000 9.004963e-001
100.0000 9.900005e-001
1000.000 9.990000e-001
… … … …
It can be seen from the table that, if |x| ≥ 10, f(x) will approach the upper limit 1, and if |x|≤10-3, function
)0())(sin(arctan)( ≥= xxxf will degenerate
to )0()( ≥= xxxf . Then the Trigonometric Function Distance is the same with Manhattan Distance. In order to get a reasonable distance range in calculating similarity, formula (3.2) can be modified as follows:
∑ =•−=
k
iyx
iiiiyxyxDis
0),( ))10|(|sin(arctan),( φ
(3.3) Where
. ⎣ ⎦⎩
⎨⎧
−−==
=otherstheyxn
yorxyx
ii
iiii |)||,min(|log
000),(
10
φ
According to Table 3-1 and our tests in CBIR, we can get a high recognition rate when n=2 or 3.
2006 1st International Symposium on Pervasive Computing and Applications
228
4. Metric Properties of Measurement
Four properties of measurement [10] [11] [12] are as follows:
1) Nonnegativity: 0),( ≥yxρ (4.1)
2) Uniqueness: yxyx =⇔= 0),(ρ (4.2)
3) Symmetry: ),(),( xyyx ρρ = (4.3) 4) Triangle Inequality:
),(),(),( yxzyzx ρρρ ≥+ (4.4) Obviously, Trigonometric Function Distance
satisfies (4.1) ~ (4.3). Then we prove that it also satisfies triangle inequality (4.4).
If we set function , then we have
)0())(sin(arctan)( ≥= xxxf
),,(|)(||)(||)(|),(),(),(
Rzyxyxfzyfzxfyxzyzx
∈−≥−+−⇔≥+ ρρρ
(4.5) In order to prove formula (4.5), we prove formula
(4.6) firstly: )()()( kfnfmf ≥+ (4.6)
Where , 0,, ≥knm knm ≥+Because
01/))(sin(arctan)( 2 ≥+== xxxxxf (4.7)
)0(0)1(
1)( 2/32 ≥>+
=′ xx
xf
(4.8)
Then
)(1/
)(1/)(
)(1/)(1/
1/1/)()(
2
2
22
22
kfkk
nmnm
nmnnmm
nnmmnfmf
=+≥
+++=
+++++≥
+++=+
(4.9) Since
),,(0|||||| Rzyxyxzyzx ∈≥−≥−+− (4.10)
Now we can get triangle inequality |)(||)(||)(| yxfzyfzxf −≥−+− .
Thus Trigonometric Function Distance satisfies all of the metric properties. 5. Analysis and results
In order to compare Trigonometric Function Distance with other similarity measures in image matching, we regard complicated manikin as the base experimental data, and adopt one group of pictures which are obtained from different angles to test. We obtain many pictures as testing database with the body that is raising the hand and bowing step on different angles at random, and give a serial number for every picture respectively.
We use hu’s moment invariants to search images which are similar to C2 from testing database and order them according to similarity distance. In fact, image 6, image 7, image 21, image 22 and image 32 are similar to C2 in testing database.
Figure 5-1 similar pictures
There are three groups of test. The first method: We regard Trigonometric Function
Distance as the similarity measurement. And Fig5-1 lists the first ten images which are similar to C2:
Figure 5-2 Matching Result of the first method The second method: We use Minkowski Distance as
the similarity measurement. And Fig5-3 lists the first ten images which are similar to C2:
Figure 5-3 Matching Result of the second method The third method: We use Euclidean Distance as the
similarity measurement. And Fig5-4 lists the first ten images which are similar to C2:
Figure 5-4 Matching Result of the third method Table 5-1 lists the place of all related images in
different matching result, and Table 5-2 lists the moment invariants and similarity distance of C2 and several related images.
2006 1st International Symposium on Pervasive Computing and Applications
229
Table 5-1 matching order of related images 6# 7# 21# 22# 32#
Case 1 4 6 1 10 2 Case 2 8 3 9 10 2 Case 3 32 14 12 18 7
Table 5-2 moment invariants and similarity distance C2 6# 7# 21#
Hu1 4.317382e-001
5.325815e-001 4.854873e-001 4.845604e-001
Hu2 4.781653e-002
5.301042e-002 6.234565e-002 4.635543e-002
Hu3 2.108305e-002
1.028148e-001 5.495855e-002 4.587050e-002
Hu4 4.576196e-003
3.533045e-003 7.327864e-003 3.214508e-003
Hu5 4.388625e-005
5.899059e-005 1.452147e-004 3.894187e-005
Hu6 5.988688e-004
-2.921560e-004
9.789784e-004 1.147414e-004
Hu7 9.718169e-006
3.247050e-005 -2.320043e-005
-2.674208e-006
1st method 4.910384e-002 2.465575e-002 2.206754e-0022nd method 1.464188e+00
0 1.281048e+00
0 1.533353e+00
0 3rd method 6.273860e-003 7.854540e-003 3.177548e-003
C2 6# 22# 32# Hu1 4.317382e
-001 5.325815e-001 4.910075e-001 3.969152e-001
Hu2 4.781653e-002
5.301042e-002 8.755620e-002 2.518971e-002
Hu3 2.108305e-002
1.028148e-001 3.443047e-002 2.707087e-002
Hu4 4.576196e-003
3.533045e-003 1.300978e-002 3.072796e-003
Hu5 4.388625e-005
5.899059e-005 2.750971e-004 1.186340e-005
Hu6 5.988688e-004
-2.921560e-004
3.108696e-003 1.661835e-004
Hu7 9.718169e-006
3.247050e-005 1.167040e-005 2.539059e-005
1st method 4.910384e-002 2.763985e-002 1.586963e-0022nd method 1.464188e+00
0 1.872089e+00
0 1.239273e+00
0 3rd method 6.273860e-003 9.215181e-003 3.987802e-003
In the first method, image 21 lies in the 1st place,
image 32 the 2nd place, image 6 the 4th place, image 7 the 6th place, and image 22 the 10th place. The precision of first ten images in matching result is 50%, and the recall is 100%.This method gives a high recognition rate.
In the second method, image 32 lies in the 2nd place, image 7 the 3rd place, image 6 the 8th place, image 21 the 9th place, and image 22 the 10th place. The precision and recall of first ten images in matching result are 50% and 100%. Though 2nd method gets the same precision and recall with 1st method, it is still worse. Because most related images are placed in the latter part in 2nd method.
In the third method, only image 32 lies in the first ten images. The precision is 10% and the recall is 20%. So this method is the worst.
In addition, we have another experiment with a larger database which has 1781 images. We search for images which are similar to image 14 from the database
and order them according to the similarity distance. With the result of image matching based on shape, we get the Precision-Recall curve [13] [14] of image 14. In Fig 5-6, line TF represents matching result of using Trigonometric Function Distance, and line Min using the Minkowski Distance, line Ou using the Euclidean Distance.
Figure 5-5 image 14
Figure 5-6 P-R curve of image 14
Because the most idealized P-R curve is a beeline
that precision equals 1, and the bigger area between curve and axes is, the better matching result is[13] [14], so as is show in Fig 5-6, the best matching result is line TF which represents Trigonometric Function Distance similarity measurement.
Table 5-3 precision and recall of image 14 Pre Re
0.166 0.25 0.361 0.444 0.500
Line TF Pre
1.00 0.909 0.684 0.516 0.514
Line Min Pre
0.909 0.875 0.684 0.470 0.418
Line Ou Pre
0.857 0.692 0.232 0.262 0.243
Pre Re
0.583 0.611 0.750 0.833 0.944
Line TF Pre
0.500 0.511 0.337 0.153 0.059
Line Min Pre
0.344 0.343 0.306 0.200 0.045
Line Ou Pre
0.228 0.152 0.100 0.077 0.038
2006 1st International Symposium on Pervasive Computing and Applications
230
Table 5-3 lists the data of image 14’s precision and recall. It can be seen from the table that, on condition of the same recall, most of precision of TF is higher than Min’s and Ou’s. So Trigonometric Function Distance gets a higher recognition rate in image matching, and it is better than Euclidean Distance and Minkowski Distance in reflecting image similarity. 6. Conclusions
This paper proposed a new similarity measurement method from a new perspective. Since the Trigonometric Function Distance of two points x, y in R is normalized to range [0, 1], the influence of “noise” in similarity measurement can be reduced. Therefore, this similarity measurement method can be used in image retrieval to improve recognition rate. To support our new theory, an algorithm for object shape analysis is designed, and experiments based on Trigonometric Function Distance are conducted. Experiments give an encouraging high recognition rate by using the new similarity measurement. So Trigonometric Function Distance is better than Euclidean Distance and Minkowski Distance in reflecting image similarity.
Acknowledgement
We would like to thank Yujie Liu for many helpful discussions. This work was supported by National Natural Science Foundation of China (grant No: 60533090), National Key Basic Research Plan (grant No: 2004CB318000) and National Natural Science Foundation of China (grant No: 60573154). References [1] Zhuang Yue-Ting, Pan Yun-He, Wu Fei. Analysis and Retrieval of Multimedia information in Internet. Beijing, Tsinghua University Press, 2002 [2] Li Xiang-Yang, Zhuang Yue-Ting, Pan Yun-He. Technology and System of Content Based Image Retrieval. Journal of Computer Research and Development, 2001, 3 (38) [3] Zhang Yu-Jin. Information Retrieval Based on Content. Beijing: Science Press, 2003 [4] Dorin Comaniciu, Peter Meer, David Tyler. Dissimilarity computation through low rank corrections. Pattern Recognition Letters 24 (2003) 227-23 [5] H.Eidenberger, Distance Measures for MPEG-7-based Retrieval. Proceedings ACM Multimedia Information Retrieval Workshop, ACM Multimedia Conference Proceedings, Berkeley, 2003 [6] Minh N. Do, Martin Vetterli: Texture Similarity Measurement Using Kullback-Leibler Distance on Wavelet Subbands. ICIP 2000 [7] Vitorio Castelli. Multidimensional Indexing Structures for Content-based Retrieval. IBM Research Report, RC 22208(98723) February 13, 2001
[8] Stefano Berreti, Alberto Del Bimbo, Pietro Pala. Retrieval by Shape Similarity with Perceptual Distance and Effective Indexing. IEEE Transactions on Multimedia, VOL.2, No.4, 225-239(2000) [9] Bian Zhao-Qi, Pattern Recognition. Beijing: Tsinghua University Press, 1988 [10] Liu Zheng-Shuai, Huang Ying, Ren Zhen-Zhong, Base of analysissitus. Zheng Zhou: Henan University Press, 1992 [11] Remco C.Veltkamp. Shape matching: Similarity measures and algorithms. In Shape Modeling International, pages 188–197, May 2001 [12] Simone Santini, Ramesh Jain, Similarity Measure. IEEE Transaction on Pattern Analysis and Machine Intelligence, 1999, Vol.21, No.9, 871-883 [13] Xu Man, Liu Yi, Wei Zhi-Hui. Technology of Content Based Image Retrieval, Computer Applications, 2001. Vol.21, No.9, 42-44 [14] Smith J R, Image Retrieval Evaluation. IEEE Workshop on Content Based Access of Image and Video Libraries. Santa Barbara California: IEEE, 1998, 112-113
2006 1st International Symposium on Pervasive Computing and Applications
231