Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How did you decide on x,y and velocity of ball to predict bounces? #11

Closed
nyck33 opened this issue Nov 13, 2021 · 6 comments
Closed

How did you decide on x,y and velocity of ball to predict bounces? #11

nyck33 opened this issue Nov 13, 2021 · 6 comments
Assignees
Labels
question Further information is requested

Comments

@nyck33
Copy link

nyck33 commented Nov 13, 2021

To predict bounce points machine learning library for time series sktime was used. Specifically, TimeSeriesForestClassifier was trained on 3 variables: x, y coordinates of the ball and V for velocity (V2-V1/t2-t1).
Additional context
Add any other context or screenshots about the feature request here.

I want to try to improve the predictive accuracy but don't want to reinvent the wheel if you can share some info on what you tried and how you decided on these three factors.

@shukkkur shukkkur self-assigned this Nov 15, 2021
@shukkkur shukkkur added enhancement New feature or request question Further information is requested and removed enhancement New feature or request labels Nov 15, 2021
@shukkkur
Copy link
Collaborator

shukkkur commented Nov 15, 2021

@nyck33 Hey, thanks for opening the issue! Yep, predicting bounces sure took us a while.
So, assuming we have x,y coordinates stored in lists from the prediction.py script

186   x = int(circles[0][0][0])
187   y = int(circles[0][0][1])

We tried different methods:

  • We thought of extracting the local minimum and maximum will give the bounces points.
    image
    red points - bounces
    After plotting the bounces, the graphs show that bounces are close to local min and max, however it can't give us accurate results .

  • Then we tried to look into points where change in ball's velocity happens.
    image
    black points - bounces
    Turned out not helpful either.

  • Looking at the previous graphs a certain pattern can be observed. Therefore, we tried to apply sklearn models. However, it couldn't capture the underlying pattern.
    df['x'].shift(1)....df['x'].shift(20) - for 20 features
    image

  • that's why we decided to use time series which captures the relationship between preceding and following ball's x,y coordinates. We experimented with sktime time series classification methods such as TimeSeriesForestClassifier() and KNeighborsTimeSeriesClassifier() and with different number of features
    Univariate Classification - predicting using just:

  1. x
  2. y
  3. V
    Multivariate Classification
  1. x,y
  2. x, y, V
    Out of all the best result gave us using TimeSeriesForestClassifier() with x,y and V features.

That's generally all the methods we have tried. If there is anything else you would like to know, let us know!

@shukkkur shukkkur pinned this issue Nov 15, 2021
@nyck33
Copy link
Author

nyck33 commented Nov 15, 2021

I tried a Kalman filter using that first plot you have up but that led nowhere. Over 80% is already pretty impressive but thanks for the clarification.

@nyck33 nyck33 closed this as completed Nov 15, 2021
@nyck33
Copy link
Author

nyck33 commented Nov 29, 2021

@shukkkur This guy https://github.com/taikoma predicted bounce location using SVM and I believe it was trajectory. He had a blog post on https://qiita.com/ (in Japanese) which I was looking for and can't find anymore.
But I remember his demo video was with the camera more behind the court (not so much from above like broadcast) and it was of a serve from the other side and he had nailed the location. I only mention this because although I am not as good at ML as you guys, I have a background in tennis coaching so want to extend what you have for a coaching app but ideally having 90 to 95% of the bounces.

@nyck33
Copy link
Author

nyck33 commented Nov 30, 2021

@shukkkur have you seen this: https://arxiv.org/abs/2008.04524

@shukkkur
Copy link
Collaborator

shukkkur commented Dec 3, 2021

@shukkkur have you seen this: https://arxiv.org/abs/2008.04524

No, I haven't. Thank you for sharing. Will make sure to have a look at it.

@shukkkur
Copy link
Collaborator

shukkkur commented Dec 3, 2021

@shukkkur This guy https://github.com/taikoma predicted bounce location using SVM and I believe it was trajectory. He had a blog post on https://qiita.com/ (in Japanese) which I was looking for and can't find anymore. But I remember his demo video was with the camera more behind the court (not so much from above like broadcast) and it was of a serve from the other side and he had nailed the location. I only mention this because although I am not as good at ML as you guys, I have a background in tennis coaching so want to extend what you have for a coaching app but ideally having 90 to 95% of the bounces.

I am not good at ML either, just an intern that doesn't understand half of what he does)
wow 90-95% is really something. Good Luck with that!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants