Output compared to Nyström's Matlab Algorithm --- needs a dataset with 'x' 'y' coordinates to run #8
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
studyforrest/data-eyemovementlabels#8
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
So for some reason all the sources of the input data from the author seem to be corrupt --- the input is basically two columns with the x and y coordinates and you can feed in specific data(screen size, viewing distance, etc). Tried it with a sample from one of our subjects by removing everything other than the x and y coordinates and the algorithm worked fine. (Note: this was just a test, and so the screen size, etc aren't according to the actual ones used in our study)
I've attached the outputs (and input: randomsample.csv) currently trying to find out what these event labels stand for (They are labelled 0-4) @AdinaWagner Any ideas?
DetectionResults.zip
The 1, 2, 3, & 4 represent classifications of eyemovements, apparently. The file "write2csv.m" contains the code
I haven't found anything relating to the 0, but I suspect those could simply be left "unlabeled". write2csv starts by initializing 5 columns of zeros
and then seems to overwrite only these rows where an event was detected. If no event was detected/classified, it should keep the initial zero.
Awesome! So would it be helpful to compare our algorithm to theirs?
We can use both algorithms on a common dataset (can the unit test generate an output with just x,y coordinates in a csv?) to see the differences. And then we can either make similar plots (see attached in OP) and compare quickly, or I can dig out number of events.
If we have a small sample we can also compare the differences in detection of events (one of the output shows velocity against time, showing saccade onset, and gliccade detection) to get an intuitive idea of what we/they may be missing, etc.
Sounds good to me!
I think both eyeballing plots and comparing/assessing differences in event detection would be good. How about using both algorithms on one of our real data files for a start (the unit test takes sub-02, run 5)?
I'll email you the file with only x and y data (I can't upload a tsv file and Alex has just warned me to never zip data because then the same kind of corruption as with Nyströms input data could happen)
@ElectronicTeaCup @AdinaWagner @mih It gets more interesting than that...
Not only is the .zip file corrupt, but on a hunch, I downloaded the file 5 times. None of the md5sums match. I then looped over each one, extracting them into the same git repo, comitting, and comparing changes. The contents change, a lot, every time, and entire files are added and removed. So, that web server simply can't be trusted.
I looked on Archive.org to see if they have cached copies of the data; they don't. And google doesn't turn up anyone hosting copies either. The guy has a GitHub profile, but doesn't really share anything there. :-/
I'll see if I can get in contact with the sysadmins of the faulty server, and will see if I can get a response.
@aqw Wow, that's pretty funky! So it there a simple solution to compress/bundle files and immortalize them? (At least, locally for long periods of time)
Here are the outputs I've gotten so far:
matlabfigure.zip --- change extension to tar if it doesn't work directly
@ElectronicTeaCup It's a complex problem, but simply using things like git can certainly make things more apparent.
I got a response from Lund's IT; they've forwarded me to the correct people. Hopefully they respond.
Trying to make a main sequence but currently the amplitudes seem to be a bit nutty.
The current counts are (sub2_run5):
Saccades: 848
Gliccades: 356
Fixations: 552
This is the current output:

Going to wait if we can get our hands on the sample data. Amp shouldn't be more than 20 (!)
@ElectronicTeaCup @AdinaWagner Awwwwwww yeah. Sysadmin underground FTW [1]. I got the data. I feel like a member of the twilight bark [2].
The data (just
InputData/, none of the.mfiles) are now ininputs/event_detector_1.1/of thetestbranch. I wasn't quite sure where you wanted it, but it seemed logical.Happy spelunking through non-corrupted data!
[1] If this thread ever becomes public: shout out to Nils Holmberg of Lund University for being one cool dude.
[2] https://www.youtube.com/watch?v=Ed_Kxyqgp1c
@aqw Thanks a bunch!
Fresh out of the box (with inputs/event_detector_1.1/) :
Saccades: 321
Glissades: 132
Fixations: 286
(What is the deal with the amplitude?)
EDIT: messed up the axis previously
Looks all good so far. I have our algorithm ready to test. To make a comparison with their data possible, I'd need a px2deg factor and the sampling rate. Do you have this info?
Found it
For some reason I thought someone said the data was 1250 Hz, but this seems to suggest otherwise.
Yes, I actually remember that too.
"The experimental setup consisted of one control computer
running SMI’s recording software iViewX with default settings
and communicating with another computer running
MATLAB to display the texts in full screen. Text images
were shown on a Samsung 19-in. flat screen with a size of
377 300 mm and viewed from a distance of 670 mm.
After a 13-point calibration, the participants were left to
read the text at their own pace. They could only move forward
through the text (by clicking the mouse). Gaze positions
were recorded monocularly (although viewing was
binocular) with the SMI HiSpeed eyetracker at 1250 Hz
throughout the experiment."
[1]https://link.springer.com/content/pdf/10.3758%2FBRM.42.1.188.pdf
Hmm, maybe these data are from a different source. Will look into the actual speeds tomorrow.
Maybe phoney labeling? I dug out the original (http://dev.humlab.lu.se/www-transfer/people/marcus-nystrom/EventDetector1.0.rar) and the data set is called "1250Hz_3_Participants.mat". But it's corrupt.
I'll run their algorithm with the different sampling rate and see what I get.
thx
Parameters:
ETparams.screenSz = [1024 768]; % pixelsETparams.screenDim = [0.377, 0.300]; % metersETparams.viewingDist = 0.67; % metersETparams.samplingFreq = 1250; % HzETparams.blinkVelocityThreshold = 1000;ETparams.blinkAccThreshold = 100000;ETparams.peakDetectionThreshold = 100;ETparams.minFixDur = 0.040; % in secondsETparams.minSaccadeDur = 0.010; % in secondsCounts are the same
https://github.com/psychoinformatics-de/studyforrest-data-eyemovementlabels/pull/1/commits/c8078accd4b3364f750f4f05f0535bc27541e043 adds a test that runs our code on a trial from the Nystrom data. Looks pretty good. Let me know what you think.
There are a few cases, where I think we should add a rule that prevents labeling too close to a missing data boundary -- or we strip more data during preprocessing.
Let me know what you think.
output after latest of your pushs looks picture-perfect for the Nyström data for me. Main sequence looks absolutely fine.
@AdinaWagner @ElectronicTeaCup if you get a chance, please run that test on all the other trials of the nystrom data and carefully go through the event sequence to see if there are ANY issues.
@ElectronicTeaCup can you get me a list of all events of all types detected from one of the nystrom data samples using the matlab code? I want to validate against that.
1_2.csv.tar.zip (rename to .tar)
This is the output that the algorithm generates for 1_2.csv. It's a bit meh since it goes frame by frame saying what that event in that particular moment is.
But i can get a count in a bit if you want, and the plot of velocities and with time, denoting which event is what (fig 9, nystrom). It's a matlab fig attached earlier (matlabfigure.zip --- change extension to tar if it doesn't work directly)
what settings did run run that with?
The stock ones. And it's for the whole set from what I recall; was super slow when I was looking at it.
Ok. The file you sent seems to be only for one trial. Processing that trial with our code takes about 5s on my machine. Which part was slow for you?
That is still ambigous (stock from paper, or stock from code), please give the numbers.
Here is the info I extract from their output (assuming:
deg_per_pixel(0.377, 0.67, 1024), sampling_rate=1250.0):And here the same info from our code:

I have run test_nystrom.py on all csv files. I have used the interactive version of the tests to look at the plots, that is my version of all code is
ffd4041. If any of the issues I point out has been fixed in later pushes, just ignore them. I feel like I'm being a bit overly detailed, but since you asked for ANY issues...Overall, everything looks good. The one thing I found which resembled something "systematic" was what I would call a misclassification of either noise or saccades after/before missing data as a pursuit (and there we less than a dozen cases in total). (see first bullet point)
In file 2_4.csv I encountered the following warnings when testing test_nystrom.py:
thats all I encountered. To me, all of that looked good.
I think this is due to the stimulus they used. AFAIK this was a reading task, hence many small saccades between words and a few big ones at the end of each line.
that makes sense. That also explains an almost complete lack of smooth pursuits very well
There should not be any. In the unit test I have set the
max_fixation_ampto 4.0 deg to pratically suppress any pursuit labeling.there are the ones I noted above. Not many, but very few. In my opinion could be ignored. To make double sure I just checked for 2_4.csv with the most recent pushes you made, I get e.g.
We could think about making a switch that disables this, but I think more information is better. There should not be any pursuits, because the stimulus is static, hence a pursuit could be a drift of the measurement -- but we are not in the position to tell.
Update: So I can get the main sequences and other data from the Nystrom algorithm after a lot of messing around (weird structs that I have not seen before) and the huge numbers were there probably due to the lack of conversion from pixel to degree (adjusting for the factor made the outputs in the proper range of values for amp)
I can't get TST to work. On python 2 I get an error mid script, and on python 3 I get a weird numpy error (which I have seen before --- so probably due to my environment?) I cloned it on two other computers but could not get the thing to work for me. Does it work on python 2? Will go on the debugger some more tomorrow, ugh.
@ElectronicTeaCup Just post the error messages and we'll figure it out. Both py2 and py3 work fine for me.
Note that the TST code already has an importer for the nystrom output CSV file that you provided. There should be no need to edit their code in any way -- this has the potential for breakage and could introduce differences that we do not want.
Okay, thanks. After a new pull I get this
And
If i force the initial lines to work by placing the needed files (detect events) into the working directory and removing the
from .then I get this:To run the tests, stay in the root of the repository and execute something like this:
The first could also be
python, and you can also givecode/testsor.or a filename, or even a single function. The--pdbwill invoke a debugger if something fails.Thanks, I had totally forgotten about that piece of code you sent me.
I got the outputs from the Nystrom algorithm and the numbers look great, and so do the main sequences! I added the outputs of the Nystrom algorithm and included a readme to state the settings used (the ones from the paper were used), also included is the number of saccades the Matlab algorithm detected before writing the csv output.
Using the test script: I found that the number of saccades when compared (using the Nystrom data set) are very similar; usually just differing by 1-5 saccades except for 1_3 in which our algorithm gave us 273 saccades as opposed to 247 (a difference of 26) from Nystom algorithm output.
@mih I don't know if it's important at this time, but looking at the variables when running the matlab script, the number of events differs a bit on some files when compared to the number seen using the test script. For example in 1_2 I would get 259 saccade events, and when I process the csv with the test script I get 248. The maximum difference was by 43 (in 1_7)
@AdinaWagner
Both cases are the same in Nystrom algorithms outputs too. The gap is more in 2_1 and 2_2 but 2_3 has a few data points:
I think we are good on this aspect. https://github.com/psychoinformatics-de/paper-remodnav