Ask Your Question
0

p, nu and coef0 parameters does not change during SVM::trainAuto training

asked 2017-12-11 09:12:06 -0600

lama123 gravatar image

updated 2017-12-11 10:21:14 -0600

Hello,

The values of p, nu and coef0 parameters are not getting updated in SVM::trainAuto training. It is always zero. The parameters gamma and cvalue are getting changed. Is this normal? Are the best values of these parameters usually zero?

The kernel type used is RBF and svm type is C_SVC

Also is there any way we can improve a two class classification other than making the parameter balanced = true in SVM::trainAuto training.

The project is forgery detection where we have to distinguish between forged and pristine images.

edit retag flag offensive close merge delete

Comments

can you show, how you call it ?

(also, just curious: "distinguish between forged and pristine images." -- images of what ?)

berak gravatar imageberak ( 2017-12-11 11:22:52 -0600 )edit

//Set up SVM's parameters CvSVMParams params; params.svm_type = CvSVM::C_SVC; params.kernel_type = CvSVM::RBF; params.term_crit = cvTermCriteria(CV_TERMCRIT_ITER, 500, 1e-6); params.gamma = .01; params.C = 12; params.coef0 = 3; params.nu = .1; params.p = 3;

    CvSVM SVM;
    SVM.train_auto(trainingMat, labelsMat, Mat(), Mat(), params);

This is on opencv 2.45, but was tested on opencv 3.1 on friends machine using trainAuto. Results are same.

Any image will do. The original is considered to be pristine. Any tampering like splicing is performed on this image. The resultant image is a forged image.Usually the image size is 1024x768 rgbimage.

Thanks for the answer.

Regards Amal

lama123 gravatar imagelama123 ( 2017-12-11 22:17:18 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2017-12-11 12:04:50 -0600

berak gravatar image

updated 2017-12-11 12:36:12 -0600

that's entirely ok, and also "on-purpose", because the only params the RBF kernel uses (with C_SVC) is gamma and C

(nu will only get changed, if you wanted NU_SVC instead of C_SVC)

(trainAuto() resets your param grids in such a way, it won't waste any computation time on unneeded things)

edit flag offensive delete link more

Comments

Thanks for the clarification @berak

Regards Amal

lama123 gravatar imagelama123 ( 2017-12-11 22:18:18 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2017-12-11 09:12:06 -0600

Seen: 331 times

Last updated: Dec 11 '17