I am studying 1-SVM, reading papers there was notation "the origin".
However, I couldn't find any explanation for the definition.
The only thing I got is the origin is just (0,0).
or...
https://www.researchgate.net/figure/One-class-SVM-the-origin-means-the-only-original-member-of-second-class_fig3_220537160
https://www.researchgate.net/figure/One-class-SVM-The-origin-0-0-is-the-single-instance-with-label-1_fig1_307538070
I can understand SVDD but 1-SVM it hard for me..
Would you explain the origin for me?
Thank you all!
It's exactly what you found: the zero-reference point for the data, which is the starting point for each of the vectors of the SVM.
If the location bothers you for some reason, you're welcome to translate the data as you wish. For instance, you could shift all the points such that the origin in at the centroid, such that the vectors will tend to radiate outward in all directions.
We're doing many strange and wonderful things with machine learning ... but we haven't yet redefined zero. :-)
It's still the origin you learned in your introduction to the Cartesian plane.
Related
Ok, so i set up a neural network through some trial and error. Going into backpropagation next. But in order to do that, i need to calculate my error on the outputs.
The situation i made for my testing area is the following. I have a car, in the corner of a maze, to navigate to the other corner of said maze.
The inputs are:
distance from wall straight ahead
distance from wall left of car
distance from wall right of car
car global X position
car global Y position
Outputs are:
Car speed forward direction
Car turning speed
All inputs and outputs are obviously normalized between -1 and +1. The car can only move forward so -1 = 0 speed, +1 = max speed. (i know the speed is kind of useless, but i wondered if it could figure out that max speed is going to get it there faster, or if it would automatically slow for a corner when it otherwise wouldn't be able to turn quick enough)
So all i know is that i want the car from current position, to end position of the maze. Not having to worry about anything else myself.
Back to the error calculation part of this script. All guides i read and followed, are asking for an error compared to output. As in, output - ideal = error The problem is that in order for it to progress to the exit of the maze, i have no clue what the ideal way of steering or speed is at that point.
To my view this can mean one of two things:
1. There are other ways to approach the error which i can use but have no knowledge of. Or there is a way to figure out the error somehow mathematically.
2. I am expecting way to much from the neural network with way to little input/output. Or asking it something it could never do. Thus i can't ever calculate the proper error.
Anyone that can help me figure out this error would be appreciated! Otherwise please explain what i am doing wrong or how i can improve the task or I/O.
Thanks in advance!
You are confusing two things. You read about supervised training of neural networks. While you try to solve the problem which is not supervised, it is rather reinforcment learning. In such setting you do not have access to "ideal" answer. You can only more or less say that current state is good/bad (like achieveing the exit of the maze is a good place, while being far is bad). Just either focus on supervised learning problems, and then resources you use are ok, or stick to your problem of a maze and switch to reinforcment learning.
I have problem at hand where I feel there should be an rather elegant solution to it, but at this point I have problems finding the right search terms or getting the first step towards the right direction.
Basics:
I have a high dimensional data space with D = 19 and have about 100 points in the space (100 measurements). With PCA and dimensionality estimation algorithms, I already confirmed that the latent space on which the points lie on is relatively low dimensional (max 5 dimensions or so). Therefore, I think in general it is not impossible what I am asking.
The problem:
Now, based on uncomplete measurements of a new point, I would like to estimate the missing values. The problem is that I do not know which values will be missing. Basically all combinations of missing values are (somewhat) similarly likely. -> I could have 1 missing value, 19 missing values or something in between. In a perfect world, the algorithm I am looking for not only gives an estimate of the missing values, but also some error measure.
To further illustrate, I attach you one image with the raw data. The x-axis shows the 19 individual measured parameters and the y axis gives the values of those parameters. You can see that the measurements are highly correlated. So even if I specify only one measurement/dimension I should be able to give a somewhat reliable estimation of the rest.
Does anyone of you have any pointers for me? Any thoughts or advice would be really helpful!
Thanks,
Thomas
The Right Way (TM) to handle missing data is to average (i.e., integrate) over the missing variables, given the values of any known variables. A Bayesian belief network is a formalization of this idea. If you can say more about what the variables are, I can say more about how to go about building a suitable belief network.
Last couple of days I spent on searching for curve reconstruction implementations, and found none - not as a library nor as a tool.
To describe my problem.
My main concern are contours with gaps:
From papers I've read in the meantime, I guess solution will require usage of Delaunay triangulation, and the method referenced most seems to be described in 1997 paper "The Crust and the β-Skeleton: Combinatorial Curve Reconstruction
"
Can someone point me to a curve reconstruction implementation, that can help me solve this problem?
Algorithm is implemented in CGAL. Example implementation can be seen in C++ in CGAL ipelets demo package. Even more compiling the demo allows user applying the algorithm in ipe GUI application:
In above example I selected just part of my image, as bottom lines did not meet necessary requirements, so crust can't be applied on that part until corrected. Further, image has to be sampled, as can be noticed.
If no one provides another implementation example, I'll mark my answer as correct after couple of days.
Delaunay triangulation uses discretized curve, and with that loses information. That can cause strange problems where you don't expect them. In your example, probably middle part on lower boundary would cause a problem.
In this situations maybe it is good to collect relevant information from model and try to make a matching.
Something like, for each end point collect contour derivative in a neighbourhood. Than find all end points to which that end point can be connected, with approximative derivative direction and that joint doesn't cross other line. It is possible to give weight to possible connection by joint distance and deviation from local derivative. Giving weight defines weighted graph with possible end point connections. Maximal edge matching in that graph would be good solution to a problem.
There are quite a few ways to solve this;
You could simply write a worm that follows the curves and when you reach the end of one, you take your current direction vector along with gradient and extrapolate it forward. Find all the other endpoints that would best fit and then score them; Reconnect up with the one with the highest score. Simple, and prone to problems if its more than a simple break up.
A hierarchical waterfall method might be interesting
There are threshold methods in waterfall (and level-set methods) that can be used to detect these gaps and fill them in.
Does anyone know the particular algorithm for Probabilistic Hough Transform in the OpenCV's implementation? I mean, is there a reference paper or documentation about the algorithm?
To get the idea, I can certainly look into the source code, but I wonder if there is any documentation about it. -- it's not in the source code's comments (OpenCV 1.0).
Thank you!
-Jin
The OpenCV documentation states that the algoithm is based on "Robust detection of lines using the progressive probabilistic hough transform", by J Matas et al. This is quite different from the RHT described on wikipedia.
The paper does not seem to be freely available on the internet, but you can purcahse it from Elsevier
The source code for HoughLinesProbabilistic in OpenCV 2.4.4 contains inline comments that explain the various steps involved.
https://github.com/Itseez/opencv/blob/master/modules/imgproc/src/hough.cpp
The article Line Detection by Hough transformation in the section 6 could be useful.
Here is a fairly concise paper by Matas et.al. that describes the approach, and as others mentioned, it is indeed quite different from Randomized Hough Transform:
http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.40.2186&rep=rep1&type=pdf
(Not sure for how long this link is going to be valid though. It's on/from citeseer, wouldn't expect it to just vanish tomorrow, but who knows...)
I had quick look at the implementation icvHoughLinesProbabilistic() in hough.cpp, because I'll be using it :-) It seems fairly straightforward, anyway, my primary interest was whether it does some least squares line-fitting in the end - it doesn't, which is fine. It just means, if it is desired to get accurate line-segments, one may want to use the start/end-point and implied line-parameters as returned by OpenCV to select related points from the overall point-set. I'd be using a fairly conservative distance-threshold in the first place, and run RANSAC/MSAC on these points with a smaller threshold. Finally, fit a line to the inlier-set as usual, e.g. using OpenCV's cvFitLine().
Here's an article about the Randomized Hough Transform which i believe to be the same as the "probabilistic Hough transform" used in OpenCV
http://en.wikipedia.org/wiki/Randomized_Hough_Transform
basically, you dont fill up the accumulator for all points but choose a set of points with a certain criteria to fill up the Hough transform.
The consequence is that sometimes, you could miss the actual line if there wasnt eenough points ot start with. I guess you'd want to use this if you have somewhat linear structures so that most points would be redundant.
reference no 2: L. Xu, E. Oja, and P. Kultanan, "A new curve detection method: Randomized Hough transform (RHT)", Pattern Recog. Lett. 11, 1990, 331-338.
I also read about some pretty different approaches where the algorithms would take two points and compute the point in the middle of those two points. if the point is an edge point, then we'd accumulate the bin for that line. This is apparently extremely fast but you'd assume a somewhat non-sparse matrix as you could easily miss lines if there wasnt enough edge points to start with.
I have a basic understanding in image processing and now studying in-depth the "Digital Image Processing" book by Gonzales.
When image given and object of interest approximated form is known (e.g. circle, triangle),
what is the best algorithm / method to find this object on image?
The object can be slightly deformed, so brute force approach will not help.
You may try using Histograms of Oriented Gradients (also called Edge Orientation Histograms). We have used them for detecting road signs. http://en.wikipedia.org/wiki/Histogram_of_oriented_gradients and the papers by Bill Triggs should get you started.
I recommend you use the Hough transform, which allows you to find any given pattern described by a equation. What's more the Hough transform works also great for deformed objects.
The algorithm and implementation itself is quite simple.
More details can be found here: http://en.wikipedia.org/wiki/Hough_transform , even a source code for this algorithm is included on a referenced page (http://www.rob.cs.tu-bs.de/content/04-teaching/06-interactive/HNF.html).
I hope that helps you.
I would look at your problem in two steps:
first finding your object's outer boundary:
I'm supposing you have contrasted enough image, that you can easily threshold to get a binary image of your object. You need to extract the object boundary chain-code.
then analyzing the boundary's shape to deduce the form (circle, polygon,...):
You can calculate the curvature in each point of the boundary chain and thus determine how many sharp angles (i.e. high curvature value) there are in your shape. Several sharp angles means you have a polygon, none means you have a circle (constant curvature).
You can find a description on how to get your object's boundary from the binary image and ways of analysing it in Gonzalez's Digital Image Processing, chapter 11.
I also found this insightful presentation on binary image analyis (PPT) and a matlab script that implements some of the techniques that Gonzalez talks about in DIP.
I strongly recommend you to use OpenCV, it's a great computer vision library that greatly help with anything related to computer vision. Their website isn't really attractive, nor helpful, but the API is really powerful.
A book that helped me a lot since there isn't a load of documentation on the web is Learning OpenCV. The documentation that comes with the API is good, but not great for learning how to use it.
Related to your problem, you could use a Canny Edge detector to find the border of your item and then analyse it, or you could proceed with and Hough transform to search for lines and or circles.
you can specially try 'face recognition'. Because, you know that is a specific topic. On the other hand 'face detection' etc. EmguCV can be useful for you.. It is .Net wrapper to the Intel OpenCV image processing library.
It looks like professor Jean Rouat from the University of Sherbooke, has found a way to find objects in images by processing neutral spiking neural network. His technology name RN-SPIKES, seems to be available for licencing.