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

Calculating MWIS becomes slow #8

Closed
ijunglee opened this issue Aug 16, 2022 · 7 comments
Closed

Calculating MWIS becomes slow #8

ijunglee opened this issue Aug 16, 2022 · 7 comments

Comments

@ijunglee
Copy link

Hi, I have tried this code on my dataset which has 100 frames. The maximum observations is 4. I noticed that the calculating MWIS procedure becames really slow after frame 49. Here are the parameters I set:

image_area = 422288 # Image width x height in pixels
gating_area = 1 # Gating area for new detections
k = 0 # Gain or blending factor
q = 0.00001 # Kalman filter process variance
r = 0.01 # Estimate of measurement variance
n = 1 # N-scan pruning parameter

Would you suggest me change any parameters to make it run faster? Thank you so much!

@jonperdomo
Copy link
Owner

jonperdomo commented Aug 16, 2022

Hi, I will be implementing other parameters soon that should speed it up, see issue #7

@ijunglee
Copy link
Author

Hi, I will be implementing other parameters soon that should speed it up, see issue #7

Thank you so much. Look forward to the update.

I also want to know how to set the parameters of gating area, k, q, r, and n.
I tried this test01.csv with one or two subjects in a frame, and the total is 60 frames.
test01.csv
The parameters I used are as follows:
image_area = 422288 # Image width x height in pixels
gating_area = 1 # Gating area for new detections
k = 1 # Gain or blending factor
q = 0.00001 # Kalman filter process variance
r = 0.1 # Estimate of measurement variance
n = 1 # N-scan pruning parameter

However, I got track 0 to 7 in my output file, which is weird.
test01_output.csv

Do you have any ideas how to solve this problem? Thanks a lot!

@jonperdomo
Copy link
Owner

Hi, below are more details on the parameters, and please browse the paper for specifics on tuning these. I would try increasing K if your measurements have high accuracy, and increasing N for a higher accuracy solution (but slower runtime) as well. I am currently working on adding the Bth and Nmiss parameters which should improve performance as well. I'm also adding the parameters as command-line arguments so you can test different values more easily.

Parameters

Modify parameters by editing the file params.txt:

Parameter Description
v The image (frame) area in pixels (Default: 307200). The likelihood under the null hypothesis for an observation becomes the probability of detection (PD) 1/V.
dth Gating area for new detections implemented as the threshold for the Mahalinobis distance d2 between the observation and prediction (Default=1000).

Kalman filter parameters:

Parameter Description
k Gain or blending factor. Higher gain results in a greater influence of the measurement relative to the filter's prediction (Default=0)
q Initial estimate of the process noise covariance (Default=0.00001)
r Initial estimate of the measurement noise covariance (Default=0.01)

Track tree pruning parameters:

Parameter Description
n Go back N frames and prune branches that diverge from the solution. Larger N yields a more accurate solution due to a larger window, but will take a longer time (Default=1).
bth If the number of branches exceeds the number Bth, then prune the track tree to only retain the top Bth branches.
nmiss A track hypothesis is deleted if it reaches Nmiss consecutive frames of missing observations, which are due to occlusion or a false negative.

@jonperdomo
Copy link
Owner

I will test with your inputs as well

@Engineero
Copy link
Contributor

Any updates on speeding up the MWIS calculation? Are the new parameters included, and if so how do I specify them?

@jonperdomo
Copy link
Owner

Still working on this, sorry!

@jonperdomo
Copy link
Owner

@Engineero I have added two missing pruning parameters from the paper: Bth for setting the maximum number of branches, and Nmiss for the maximum number of consecutive frames with missing observations for a track in commit 5627c53. Please try adjusting these parameters to improve performance.

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

No branches or pull requests

3 participants