Data Science Asked by Simon Q. on September 4, 2021
$$input = X = [position_{t_{0}}, position_{t_{1}}, …, position_{T}]$$
$$output = y = parameters of observed orbit$$
Positions are (x, y) coordinates and the parameters are a handful of values that describe an ellipse in a 2D plane.
configured trajectory LSTM
or shape parameter prediction RNN
.The Issue: Results are bad, my ellipses do not have the expected shape. I have absolutely no idea if this is the RNN I should be using and if it is, what layers I should or shouldn’t add. I couldn’t find relevant literature on the internet and pages that tackled configured trajectories
were talking about predicting the next position of a car, while in my case I’m trying to compute an estimation of the whole trajectory.
What I’m looking for: Really anything related to determining geometrical parameters based on sequential observation or relevant literature about how to design models that use LSTM for this kind of problems. Any advice from LSTM-RNN-savvy people or orbital-element-estimation-specialists would be greatly appreciated.
If you know that your trajectory has a certain parametric form then you can use methods that explore the parameter space for that form. Examples of such methods are Hough transform and custom-built moments.
Hough transform maps a point in a real space into a manifold in the parameter space, and vice-versa, it maps a point in the parameter space into a line in the real space. If you have several points in the real space, they are transformed into the same amount of manifolds in the parameter space. These manifolds intersect in a point whose coordinates are the parameters of the line that goes through your data.
The parameter space for the ellipse is five-dimensional, so a naive application of the Hough transform is inefficient. Smarter implementations are known, e.g. [1].
The method of custom-built moments described in [2] allows to find the parameters of a curve expressible as $$G(x,y) = sumlimits_np_nz_n(x,y)=0$$ In the case of an ellipse, we have
$$G(x,y)=p_1+p_2x+p_3y+p_4x^2+p_5y^2+p_6xy=0$$
that is $z_1=1$, $z_2=x$, $z_3=y$, $z_4=x^2$, $z_5=y^2$, $z_6=xy$. You want to determine $p_1,...,p_6$ based on your data.
Enclose the portion of the curve where you have your data in a rectangle, and make a coordinate transformation so that your rectangle is now $ S = [-1 le x le 1, -1 le y le 1]$. The rectangle is separated by the curve into two regions. Assign the value $1$ to all points from one of the regions, and $0$ to all points in the other region. For example, in this Figure, all black points are $1$, and white points are $0$.
The data points are on the boundary. They are not explicitly shown in the figure because their exact position is not important anymore. It is also not important, how many points you have (as long as they clearly determine the shape of the curve segment) and in which order you collect them.
So, now you have a function defined on the rectangle: $$I(x,y)=begin{cases} 1 & (x,y) in Region~1 \ 0 & (x,y) in Region~2 end{cases}$$
The parameters $p_1,...,p_6$ are found as the solution of a system of equations $$sumlimits_nu_np_n=0$$ where $u_n$ are custom moments $$u_n=iint_S I(x,y)U_n(x,y) ,dx,dy$$ The functions $U_n$ are defined as $U_n(x,y)=Upsilon(F,s,z_n)$ where $$Upsilon(F,s,z)=left([sz_y-zs_y]Fright)_x-left([sz_x-zs_x]Fright)_y$$ with the $x$ and $y$ subscripts indicating partial differentiation. The functions $F(x,y)$ and $s(x,y)$ are arbitrary. They can be anything you like as long as $F$ is continuously differentiable, $s$ is twice continuously differentiable on an open set containing the rectangle $S$, and $F=0$ on the boundaries of $S$. More details in [2]. If you don't understand that paper during the first reading, read [3] first, and if you don't understand [3], read [4], then read [3], after which [2] should become clearer.
For ellipses, the authors of [2] recommend to generate 18 arrays of functions $U_n = (U_1,...,U_6)$ from combinations of three functions $F_1 = m_0n_0$, $F_2=xF_1$, $F_3=yF_1$ with six functions $s_n=z_n,, n=1,...,6$, where $m_0=1-x^2$, $n_0=1-y^2$. With the additional notations $m_1=1-2x^2$, $n_1=1-2y^2$, $m_2=1-3x^2$, $n_2=1-3y^2$, these 18 arrays are found to be
After taking the integrals of these $U_n$ with $I(x,y)$ you get a $18 times 6$ matrix $U$ of the moments $u_n$. Taking the eigenvector associated with the smallest eigenvalue of $U^TU$ as described here, you will get the parameters $p_1, ... p_6$.
I tested them on the curve segment in the figure above. The segment is from an ellipse $$frac{((x-1)cos(frac{pi}{6})+(y+1)sin(frac{pi}{6}))^2}{2^2} + frac{((x-1)sin(frac{pi}{6})-(y+1)cos(frac{pi}{6}))^2}{1^2} = 1$$
I got the following result
[ 1. -1.70012217 2.53636068 0.49314339 0.91927365 -0.74693632]
which is not very accurate but I used a 2D-trapezoid rule for integration as described here and took a uniform $600 times 600$ grid. You will definitely get better results with a more sophisticated grid and integration rule.
References
Correct answer by Vladislav Gladkikh on September 4, 2021
You can use a semantic autoencoder as described in [1]. For example, such network:
The encoder is a neural network, and the decoder is the equation of ellipse. Input data can be transformed to the same size via interpolation. The network may learn better if you tinker with the form of the input (e.g pairs of coordinates at a certain distance, etc) and the topology of the encoder. In this way, it is possible to learn e.g. what is the minimum amount of data from which the parameters of an ellipse can be recovered.
Also, another neural network can be put for the decoder. In that case, the bottleneck layer will be a vector of some numbers that represent the input ellipse (i.e. a descriptor of the ellipse) but they will not be the parameters of the ellipse equation. However, training data can be used to map this descriptor to the parameters of the ellipse equation.
Answered by Vladislav Gladkikh on September 4, 2021
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP