Embodiment
In conjunction with accompanying drawing, elaborate below the practical implementation step.
Shown in accompanying drawing 1, the present invention realizes the three-dimensional model main-process stream of classification automatically, and this general flow chart has comprised realizes each required key step of final classification.At first; A given three-dimensional grid model, the geodesic line distance on any two summits of Calculation of Three Dimensional model is carried out dimensionality reduction and feature decomposition to the geodesic line distance matrix then; Obtain the three-dimensional grid model global characteristics; This characteristic use SVMs makes up the binary classification device classifies to it, and adopts " one to one " of SVMs binary classification device to constitute the multivariate classification device in twos, utilizes this multivariate classification device can obtain classification results.At test phase, can be through the three-dimensional grid model global characteristics that obtains, be input to SVMs binary classification device and the multivariate classification device is tested.Therefore, the present invention can realize three-dimensional model is classified automatically.
In conjunction with accompanying drawing, elaborate below the practical implementation step.
One, the geodesic line distance on any two summits of Calculation of Three Dimensional model.
The present invention's hypothesis three-dimensional model to be classified is showed by polygonal mesh, and each grid is made up of according to topological relation summit, limit, polygon.The present invention obtains the global characteristics of each grid through the distance on characterization summit, utilizes the global characteristics training classifier that the distance feature of new input is classified.But; The present invention does not directly use the Euclidean distance on summit to carry out characterization, and reason is that Euclidean distance can't tackle the non-rigid deformation of 3D grid, yet; All there are certain flexible conversion such as bending in a lot of three-dimensional models; Therefore Euclidean distance will be relatively poor to the non-rigid transformation robustness, directly influence final classification results, make this sorter nicety of grading variation.Therefore, the present invention adopts the geodesic line distance on summit to obtain the global characteristics of 3D shape, and the geodesic line distance can not bend along with the part of a 3D shape and change, and this distance is constant for non-rigid transformation.
The geodesic line on any two summits distance is actually from shortest path of reaching home of starting point dynamic programming on the 3D grid.If there are any two adjacent vertexs on the path of starting point and terminal point, be respectively vi and vj, the shortest path of starting point and terminal point can be reached an optimization problem with formula table:
The present invention is through finding the solution above-mentioned optimization problem, thus any 2 the geodesic line distance of Calculation of Three Dimensional grid.Method is following:
If the initial vertex is v
0, the termination summit is v
nEach vertex v on the path of starting point between to terminal
iWriting down arrive starting point geodesic line apart from d
i, d wherein
i∈ R is v from the initial vertex
0To any vertex v
iThe length of shortest path.v
I-1Be v
iThe neighbour's 3D grid summit that connects, its distance is weighed with Euclidean distance.The expression formula of optimization problem is following:
d
0=0
d
i=min(d
i-1+||v
i-1-v
i||)
The present invention adopts dynamic programming method, utilizes iterative planning mode, guarantees that footpath, each step is the shortest, dynamic cook up net result, this method can produce the shortest path of the overall situation.This dynamic programming process utilizes width searches to realize, promptly each search travels through the k-neighbour on 3D grid summit.The present invention adopts summit, limit and polygonal neighbour's store list to realize the 3D grid topological structure; Create the neighbor lists on summit, the neighbor lists on limit, polygonal neighbor lists in the 3D grid read-in process; And; The neighbor lists on summit has comprised neighbour summit, neighbour limit, neighbour's polygon, and the neighbor lists on limit has comprised neighbour summit, neighbour limit, neighbour's polygon, and polygonal neighbor lists has comprised neighbour's polygon.Therefore k-neighbour's traversal only needs the time complexity of O (1), can guarantee that traversal speed is enough fast, thereby increase dynamic programming speed.In addition, in order further to accelerate planning speed, to tackle large-scale 3D grid, the present invention has increased by two constraint conditions in the process of dynamic programming, and the 3D grid summit of promptly satisfying this constraint condition preferentially travels through.
Article one, constraint condition does
(v
i-v
s)·(v
t-v
s)>0
This constraint condition is arranged the planning direction (v of each dynamic programming in fact
i-v
s) and origin-to-destination direction (v
t-v
s) unanimity.This direction is the direction of preferential planning, can stop planning in case reach home, and increases the speed that this constraint condition will increase dynamic programming greatly, makes the computing velocity of any 2 geodesic line distances accelerate.
Second constraint condition does
d(v
i,v
s)≥||v
t-v
s||
2
This constraint condition guarantees that in ergodic process, the geodesic line on two summits is apart from d (v
i, v
s) must be greater than the Euclidean distance of terminus || v
t-v
s||
2Because 2 bee-lines that Euclidean distance is the space necessarily smaller or equal to 2 geodesic line distance, therefore in planning process, when also not reaching Euclidean distance, need not to judge whether arrived terminal point, can save time.
Above-mentioned steps of the present invention can be calculated any geodesic line distance fast at 2.
Two, the dimensionality reduction of geodesic line distance matrix and feature decomposition.
Geodesic line distance through any two summits of step 1) Calculation of Three Dimensional grid; Thereby constitute a higher dimensional matrix D; Wherein the index of row and column corresponding the index on 3D grid summit, each matrix element is being represented the geodesic line distance on any two 3D grid summits.Because the eigenwert of geodesic line distance matrix has been represented the global characteristics of this 3D grid, the present invention considers this geodesic line distance matrix is carried out feature decomposition.Yet extensive Three Mesh has the above summit quantity of N=1M, will constitute the higher dimensional matrix of N*N=1M*1M, and this matrix is carried out feature decomposition needs O (N
3) computation complexity, in a rational time, can't realize at all.Therefore; The present invention has studied a kind of dimension reduction method of higher-dimension geodesic line distance; This method purpose is the few representative summit of sampling from the extensive summit of 3D shape; The feature decomposition approximately equal of the higher dimensional matrix that these summit geodesic lines constitute apart from the low dimension matrix that constitutes and all summits, thus avoid higher dimensional matrix is carried out the calculating pressure of feature decomposition, accelerate training speed of the present invention greatly and moved classification speed.Shown in accompanying drawing 2, this dimension reduction method step is following:
1) calculate the mathematical expectation of all geodesic line distances, (i j) is the geodesic line distance of two vertex index i and j to d here.
d
m=E[d(i,j)]
2) establishing the dimensionality reduction matrix is L, is initially sky.At first select a pair of vertex index (x of geodesic line apart from maximum
1, x
2), adding empty dimensionality reduction matrix L to, this dimensionality reduction matrix is changed to:
3) according to the original matrix indexed sequential, the tabulation of traversal grid vertex is with having selected the respective on summit to be appended in the matrix L in vertex index x that satisfies following two conditions and the dimensionality reduction matrix.
A) this summit x is to all vertex index x of matrix L
jGeodesic line distance greater than mathematical expectation d
m:
B) this summit x is to all summit x of matrix L
jGeodesic line maximum apart from sum:
4) repeating step 3), any stop condition below satisfying:
A) number of vertices of matrix has surpassed setting value k.In this patent, set k=64;
B) do not had the 3D grid summit to satisfy 3) condition that sets of step.
After above-mentioned dimensionality reduction step, the dimension of original matrix D is reduced to the k value, is easy to carry out at short notice feature decomposition.Yet after having carried out the matrix dimensionality reduction, we further carry out Gaussizationes to the geodesic line distance, and its purpose is to reduce the influence of long geodesic line distance to feature decomposition, strengthen the robustness of this sorting technique.Method is following:
Wherein, be d
Ij2 geodesic line distance, σ is Gauss's width, d '
IjGeodesic line distance for Gaussization.In this patent, we define Gauss's width cs and do
σ=max(i,j){d
ij}
The i.e. maximal value of the geodesic line distance between all summits.σ is defined as the relevant form of this data, and that last feature decomposition result is accomplished even convergent-divergent is constant, and the present invention defines this value purpose and is geodesic line apart from carrying out standardization.The present invention can learn that through the observation to lot of experiment results as long as σ is enough big, last feature decomposition is metastable about σ.
After the geodesic line distance matrix was carried out dimensionality reduction and Gaussization, the present invention carried out feature decomposition to matrix D, calculated its eigenwert.The feature decomposition formula is following:
Dv=λv
Wherein, this patent adopts general Jacobi method to carry out feature decomposition, and eigenwert is sorted from big to small.
The vector
that the present invention constitutes eigenwert will block from the less eigenwert of setting of c and give up through blocking (cutoff) mode dimensionality reduction once more.In this patent,, set c=16 through experimental observation.Vector behind the dimensionality reduction
will be as the input feature vector of sorter of the present invention; Input feature vector through calculating each sample is trained sorter; Equally; In the actual motion; Extract this input feature vector earlier, be input to then and trained the sorter of completion that it is classified.
Three, utilize SVMs to make up the binary classification device of three-dimensional model characteristic.
The present invention dissolves many classification problems and is a plurality of binary classification device combinatorial problems.There is certain corresponding relation between many classification problems and the binary classification problems.If a problem is that multiclass can be divided, then necessarily can divide between any two types in this multiclass; Otherwise, in classification problem more than, if known its any two all right one way or the other branch then through certain combination rule, can all right one way or the otherly assign to finally realize that multiclass can divide by two.The different combinations rule has just formed different sorting algorithms, and combination rule will be set forth in step 4) in detail.The present invention proposes to adopt support vector machine method to step 2) the three-dimensional model characteristic extracted carries out binary classification.Based on the classification process of SVMs shown in accompanying drawing 3, through step 2) characteristic of extracting one group of three-dimensional grid model is as classification samples, is divided into training set and test set; SVMs of the present invention is trained; Select kernel function, and pass through the normal direction coefficient of optimal way selection sort face, and confirm the migration parameter of classifying face through the support vector set; To confirm classifying face; Form the binary classification device, be combined as the multivariate classification device through the binary classification device then, can the output category result for training set and test set.Binary classification device implementation method based on 0 SVMs is following.
Suppose for the feature samples collection (x that constitutes by three-dimensional grid model
i, y
i), wherein, i ∈ [1, n], characteristic x
i∈ R
M, be positioned at the feature space that M ties up.y
i{+1 ,-1} is a class label to ∈.The feature samples collection can obtain the classifying face equation and is thus:
H(x)=ω
Tx+b=0
Wherein ω is the vector of M dimensional feature space, is the normal direction coefficient of classifying face, and b is a scalar, is the migration parameter of classifying face.Utilize ω and b can confirm the position of classifying face.The classifying face of being constructed need significantly separate two types of samples, promptly satisfies and works as y
i=1 o'clock, H (x
i)=1, same, work as y
i=-1 o'clock, H (x
i)=-1.
Shown in accompanying drawing 4,, under the condition that two types of samples are correctly separated, make the class interval maximum based on structural risk minimization.Classifying face is located in the centre of two boundary lines, the point that defines boundaries through support vector.After support vector obtains, just no longer need other sample, can the reduced sample processing time.According to geometric knowledge, the distance of two boundary lines is 2/|| ω ||
2, the method that this aspect adopts promptly utilizes optimization method to obtain maximum distance, promptly minimizes
The present invention considers disturbing factor, introduces slack variable ξ and penalty coefficient C, confirms that the problem of classifying face can be converted into finding the solution of following optimal problem, introduces two constraint conditions:
y
i(ω
Tx
i+b)≥1-ξ
i
ξ
i≥0
Under above-mentioned constraint, ask function
Minimum value.This constrained optimization problems can be found the solution through structure Lagrange function, and structure Lagrange function is following:
Find the solution Lagrange minimum of a function value, above-mentioned function is asked its minimum value about ω and b, this minimum value must be tried to achieve at the saddle point place.Therefore, this saddle point satisfies following condition:
α
i(y
i(ω
Tx
i+b)-1+ξ
i)=0
β
iξ
i=0
α
i≥0,β
i≥0,ξ
i≥0
Find the solution and obtain:
α
i+β
i=C
Be updated in the Lagrange function, obtain:
Alpha wherein
iSatisfy
α
i≥0
Therefore, utilize the classifying face parameter of above-mentioned optimum to set up following discriminant classification function:
Wherein,
Here U expresses support for the element number of vector set.
The present invention is according to the symbol of the value of H in the formula (x), the classification of binary classification under the judgement sample x.
The present invention has adopted nonlinear method to attempt the 3D grid characteristic is carried out binary classification, utilizes Nonlinear Vector that the 3D grid Feature Mapping is arrived high-dimensional feature space, makes its linear separability.The definition Nonlinear Vector
This vector is tieed up input feature vector x with m and is mapped to the k dimensional feature space, makes its this grouped data can linear separability at high-dimensional feature space.The respective classified discriminant function is:
We consider to introduce kernel function K (x
iX) higher-dimension calculates the initiation calculation of complex and crosses problem concerning study in the solution following formula.As long as find a suitable kernel function that satisfies the Mercer condition in the input space, just can replace the inner product operation of high-dimensional feature space with this kernel function, the discriminant function of the optimal classification face of being constructed is:
The present invention has attempted three kinds of kernel functions commonly used, comprises radially basic kernel function of linear kernel function, Gauss and Sigmoid kernel function.Wherein the linear kernel function expression formula is following
K(x
i·x
j)=x
i·x
j
The gaussian radial basis function expression formula is following:
Wherein σ is the variance of sample.
The expression formula of Sigmoid kernel function is following:
K(x
i·x
j)=tanh{gx
i·x
j-h}
It constitutes the multilayer perceptron neural network, and wherein parameter g is a scale factor, and h is a displacement factor.
Find that through test the Gauss radially kernel function of base has provided classification performance preferably, therefore, the present invention adopts the kernel function of gaussian radial basis function as SVMs.
Four, utilize the binary classification device to be combined into the multivariate classification device
Because the 3D shape classification problem mainly concentrates on many classification, the binary classification device that the present invention adopts step 3) to make up is combined into a multivariate classification device.Usually, many sorting techniques mainly contain: one to one, and one-to-many and directed acyclic graph.Wherein classification is many preferably classification one to one, is applicable to practical application, and counting yield is higher, and two types of samples tend to balance, and makes discriminant classification more become to rationalizing.The present invention uses is classification one to one.For the K classification problem, K class training sample is made up in twos, can make up L=K (K-1)/2 training set, use SVMs binary classification device that every pair of training set is learnt respectively, produce L binary classification device.In to the classification of test sample book, adopt " ballot method ":,, add a ticket to such if sample x output result is judged to be such with L the binary classification device of test sample book input by K class sample architecture.All L binary classification devices to the test sample book classification after, in the K class which kind of who gets the most votes, just judge which kind of test sample book belongs to.Thereby the present invention has realized the automatic classification method of a three-dimensional model.
Effect of the present invention can further specify through following experiment.The experimental data collection is from Canadian McGill University Shape Benchmark, and this three-dimensional modeling data collection comprises 10 types of common shape altogether, comprises animal, people, machinery etc., and specific category is seen table 1.The present invention is divided into training set and test set with this data set.The training set comprises 10 types of shapes, every type of 10 models, totally 100 models.The test set comprises 10 types of shapes, every type of 10 models, totally 100 models.Training obtains the multivariate classification device on training set, the classification results of assessment multivariate classification device on test set.During training, distribute class mark separately to 10 types of shapes of training set respectively, get wherein any two types sample value and carry out training study, so just can obtain a multivariate classification device of forming by 45 binary classification devices.During test 10 types of sample values are imported this multivariate classification device successively and just can obtain all classification results.Classification results is added up, and statistics is as shown in table 1, and wherein error rate and accuracy are meant that respectively the number of the three-dimensional model that classification error and classification are correct accounts for the number percent of disaggregated model total number.
The nicety of grading of table 1 the present invention on the three-dimensional model test set
From classification results, can find out; The nicety of grading of the three-dimensional model automatic classification method that the present invention proposes reaches 86%; This has certain superiority in existing three-dimensional model sorting technique; Performance with good classification simultaneously, is tackled complicated universal model and non-rigid transformation and is had stronger robustness.Above integral body is said to be preferred implementation of the present invention; Those skilled in the art are under the prerequisite that does not break away from the principle of the invention; Can make some improvement, comprise kernel function that changes SVMs etc., scope of the present invention is appended claims and be equal to and limit.