-
Notifications
You must be signed in to change notification settings - Fork 45
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
Automatic recognition of channel contents #204
Comments
I think this should be pretty easy to do with a supervised machine learning algorithm (a SVM maybe?). I don't think much training data would be necessary to make it work. I do have a concern though. How do you differentiate between CO2 and O2? Is this differentiation critical or is it okay if the algorithm incorrectly names these two? |
That's one issue. The other is where do we find a big dataset to train that SVM? |
We could try with the data we have. |
I don't think we have enough samples, but it could be a starting point |
Training an SVM could be an option. We have a lot of data in house that could serve as training dataset for some types of physiological data - but we'll have to wait to make it public first, probably. At the beginning, we could make a simple suggestion dividing triggers from pulses from general respiration based channels. In fact, the latest BIDS stable release suggests only three column headers. However, it is very important that there is no mistake in classification (CO2 and O2 are not equivalent, so we shouldn't treat them as such!), especially if we keep expanding the Why don't we wait to see if during the BrainWeb there is someone more experienced in machine learning or pattern recognition that could help us with their expertise? |
That's what I was thinking, to use the in house data to train the SVM. Regarding the CO2 and O2, that's why I was pointing out that we should find a way of correctly differentiating them. To me the signals look pretty much complimentary, meaning that an SVM algorithm may fail to correctly assign headers for this data. Checking with people at the BrainWeb hackathon sounds good to me 😉 |
A few quick thoughts:
|
I think that the training (if any) will take place offline - the projection on new data could take place on request. It's true that most software lets you name the channels, but sometimes such channels are set for the software in a multi-user lab and they don't have the right name. |
Hi, hoping this issue is still of interest! I have done a quick frequency analysis. What I did to each signal:
Some ideas about the results:
A few questions that come to my mind:
|
Thank you @drombas ! Those are great ideas we can build up on. We already know where the power of the cardiac and respiratory spectra should fall. Those would be the easiest to find by just looking at the spectra. Also, between O2 and CO2, the former has a higher amplitude. So, I would calculate the PSD of all the channels, then find the one with cardiac frequency (there goes one channel) and another channel (or two) with the respiratory frequency. Between the respiratory ones, we set the one with the highest amplitude to O2, and the other one to CO2. Finally, If the trigger only takes 2 different values; i.e. it's binary, the mean should be much closer to the baseline than to the maximum value. Also, if it's binary and we separate the baseline from the maximum values, we could check that the sum of all the values in the baseline is actually the minimum value times the number of points below the average (and the same with the maximum). These may not be as fancy as doing an SVM but they could work and should be fairly simple to implement. |
I can't find the option to self-assign this issue but just to let you know I'm actively working on it. Thanks @eurunuela for the suggestions! As you said I will probably go for a time-domain detection of the trigger based on its binary nature and a spectral-domain classification between cardiac and respiratory signals. |
Detailed Description
The content of a BIDS physiological file contains is described in its companion
.json
file - where an important entry contains the column header.At the moment,
phys2bids
fills that entry either using the name of the channels from the original file or using the list that the user provides with the option-chnames
.Look at the channels from our tutorial file,
It's quite easy for a human (that has a little acquaintance with physiological recordings) to make an educated guess on what is the content of each channel. We could write a function that does that "educated guess" and suggests a column header for each channel to the user.
Context / Motivation
BIDS suggests specific column headers for the files, and it would be great if we could help the standardisation of this report by adding such function.
Possible Implementation
The first thing that comes up in my mind would be a sort of pattern recognition function/comparison with a database of physiological recordings.
Triggers are normally spiky (or blocky), pulses have quite a recognisable pattern, respiration another one. Chest expansion-based respiration recordings are normally smoother than others, while O2 and CO2 could have tidal shape responses and they are normally the inverse of each other.
@RayStick @BrightMG @CesarCaballeroGaudes and @rmarkello might have even better ideas!
The text was updated successfully, but these errors were encountered: