-
Notifications
You must be signed in to change notification settings - Fork 0
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
Update README.md #2
Open
lalou97
wants to merge
56
commits into
iss1
Choose a base branch
from
lalou97-patch-iss1-add-bio
base: iss1
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+2,626
−4
Open
Changes from all commits
Commits
Show all changes
56 commits
Select commit
Hold shift + click to select a range
5e69351
Update README.md
lalou97 ab94a00
Update README.md
lalou97 2a03ee0
Update README.md
lalou97 f0d5a14
Update README.md
lalou97 b8c23e4
Update README.md
lalou97 c4b2e3d
Update README.md
lalou97 ce7776f
Update README.md
lalou97 bbd5bd0
Create notebook.ipynb
lalou97 f41e7c9
Update README.md
lalou97 a70a9e0
Update README.md
lalou97 5154e3c
Update README.md
lalou97 b0cec4e
Update README.md
lalou97 e73c792
Rename notebook.ipynb to Nimare
lalou97 a9f7361
Add files via upload
lalou97 bbf94ce
Delete Meta Needs vs Wantings -NiMARE.ipynb
lalou97 6fca015
Add files via upload
lalou97 3936cde
Add files via upload
lalou97 ebad1b7
Update README.md
lalou97 8d9fcff
Update README.md
lalou97 253deb0
Update README.md
lalou97 646b6d3
Update README.md
lalou97 19bd49a
Delete Meta Needs vs Wantings -NiMARE.ipynb
lalou97 33d51b7
Delete Needs vs Wantings 2.0.ipynb
lalou97 293563d
Delete Nimare
lalou97 b69bb86
Create Jupyter notebook
lalou97 adf95d3
Delete Jupyter notebook
lalou97 71c2611
Add files via upload
lalou97 cf204e9
Delete Needs vs Wantings 2.0.ipynb
lalou97 4c93535
Create Need vs Wants
lalou97 218e50f
Create All coordinates
lalou97 da36d9c
Add files via upload
lalou97 9e5535e
Update README.md
lalou97 110faf7
Update README.md
lalou97 aa641d4
Delete Need vs Wants
lalou97 9ba6fce
Add files via upload
lalou97 99bec3c
Delete Capture d’écran, le 2021-09-03 à 14.35.18.png
lalou97 92610a4
Add files via upload
lalou97 704a06a
Update README.md
lalou97 364f137
Add files via upload
lalou97 97996be
Update README.md
lalou97 1d30476
Update README.md
lalou97 c466e20
Add files via upload
lalou97 af7cc2a
Delete All coordinates
lalou97 61c017e
Update README.md
lalou97 f04c581
Update README.md
lalou97 c5b1aad
Update README.md
lalou97 4cdf019
Add files via upload
lalou97 b0213c1
Add files via upload
lalou97 4f96a46
Add files via upload
lalou97 cccab9f
Update README.md
lalou97 a050e2d
Delete Feature importance.mov
lalou97 9ab826e
Add files via upload
lalou97 ce58827
Update README.md
lalou97 fe740a3
Add files via upload
lalou97 8d8d1cf
Update README.md
lalou97 bf427a1
Update README.md
lalou97 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
2,479 changes: 2,479 additions & 0 deletions
2,479
Jupyter notebook/Notebook_Classification_needs_wants.ipynb
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,147 @@ | ||
# lgrenier_project | ||
BIO | ||
My name is Laurence, I am a master student in psychology at Montreal University. | ||
I am interested in social neurosciences and cognitive neuroscience. | ||
# Using ALE algorithm and machine learning to classify need and desire states | ||
|
||
### Personal background | ||
|
||
##### My name is Laurence and I've completed a bachelor's degree in cognitive neuroscience at Montreal University. I am currently a master student in psychology at Montreal University. I am particularly interested in social neurosciences, thereby working at the NeSC (Neuroscience en contextes sociaux)lab. My master project is a coordinate based meta-analysis on social hierarchy. | ||
|
||
##### I really wish to contribute to scientific findings by adopting approaches that consider the current issues of reproductibility and social inclusion in neuroscience! I've decided to do brainhack school in order to familiarize myself with coding and neuroimaging datas. | ||
|
||
|
||
|
||
<a href="https://github.com/lalou97"> | ||
<img src="https://avatars.githubusercontent.com/u/87998890?v=4" width="100px;" alt=""/> | ||
<br /><sub><b>Laurence Grenier</b></sub> | ||
</a> | ||
|
||
* * * | ||
|
||
# Project Definition | ||
* * * | ||
|
||
## Using ALE algorithm and machine learning to classify need and desire states | ||
|
||
|
||
### Theoritical background | ||
* * * | ||
##### Overconsumption is associated with several environmental, social and individual problems (Lipschutz, 2001). One explanation suggested for overconsumption is that "we consume what we want belong what we need" (Stearns, 2006), (Juvénal et al., 2021). Some stimuli are sought for their survival value (food, water,...), while others are sought for their reward value (money, interesting objects,...). While motivation towards the former seems to increase, or even be triggered, by a state of deprivation, motivation towards the latter seems to increase as a function of the previously learned value of the stimulus, corresponding to the association between this stimulus and a reward. However, since a stimulus can be pursued for its *needing* value **AND** for its *wanting* value, for example some kind of food, or even some activities, we can wonder what are the similarities and the differences between those two conditions at a neural level? | ||
|
||
|
||
##### To answer this question, we previously made a coordinate-based meta-analysis with the ALE (Activation likelihood estimation) algorithm in order to find the consistent activations reported in the litterature for each of those conditions. Therefore, we identified regions more commonly reported in the experiments regarding *needs* than in the expriment of *wantings*, vice versa. | ||
|
||
#### ALE | ||
* * * | ||
##### The ALE approach is used to show the convergence between the regions reported in the litterature of a specified topic. For each of the selected studies, the coordinates of the significant voxels are taken (activation peaks). Then, the algorithm is making a gaussian matrice representing the spatial uncertainty, based on the sample of the corresponding study, around the activation peaks reported and thus making what is call a *MA map (main activation map)*.Therefore, each of the experiment has it own *MA map* where each voxels is associated with an activation probability (that increase in the closest to the peaks).Then, the union of the MA maps are taken and the algorithm is making permutations to identify which activations peaks are significantly reported across the experiments, thus representing the convergence of activations. | ||
|
||
###### [Acar, F et al.,2018](https://journals.plos.org/plosone/article?id=10.1371/journal.pone.0208177) | ||
|
||
|
||
[![ALE description!](https://github.com/PSY6983-2021/lgrenier_project/blob/lalou97-patch-iss1-add-bio/images/Step-by-step-overview-of-the-ALE-algorithm-From-an-entire-Statistical-Parametric-Map.png)](https://journals.plos.org/plosone/article?id=10.1371/journal.pone.0208177) | ||
|
||
|
||
|
||
### Objectives | ||
* * * | ||
|
||
##### The goal of the present project is to build a machine learning model which will make the distinction between the studies focusing on the *needs* and the studies focusing on the *wantings* based on the MA maps generated by ALE algorithm during the first step. | ||
|
||
##### The puposes of this project are : | ||
##### - Build a machine learning model which will classify the *needs* and the *wants* state based on studies included in the meta-analysis to train the model. | ||
##### - Retrieve the most contributing features in the machine learning classification model and interpret the coefficient's value in comparison of ALE meta-analysis results. | ||
##### - Familiarize myself with open science pratices, programming and machine learning. | ||
|
||
|
||
### Tools | ||
* * * | ||
##### - Python | ||
##### - Jupyter notebooks | ||
##### - [nilearn](https://nilearn.github.io/index.html#) | ||
##### - [scikit-learn](https://scikit-learn.org/stable/index.html) | ||
##### - github | ||
##### - [nimare](https://nimare.readthedocs.io/en/latest/about.html) | ||
|
||
|
||
### Data | ||
* * * | ||
|
||
#### The dataset is composed of all the activation peaks of included studies in the meta-analysis. | ||
|
||
### *needs* : 38 studies | ||
##### Contrasts of interest were meeting those criterions: | ||
##### - Perception of a food stimulus during a hunger state > perception of a stimulus during a satiety state. | ||
##### - Perception of a food stimulus during a hunger state > perception of a non-food stimulus during a hunger state. | ||
|
||
### *wantings* : 33 studies | ||
##### Contrasts of interest were meeting those criterions: | ||
##### - Perception of a cue announcing a reward (or a larger reward) > perception of a cue not announcing a reward (or a smaller reward). | ||
|
||
#### Here's all the coordinates of the sample in the brain. | ||
### - Green : Needs | ||
### - Red : Wants | ||
![coordinates gif!](https://github.com/PSY6983-2021/lgrenier_project/blob/lalou97-patch-iss1-add-bio/images/All_coordinates_Enregistrement%20d%E2%80%99e%CC%81cran%2C%20le%202021-09-02%20a%CC%80%2015.32.05%20(1).gif) | ||
|
||
|
||
### Deliverables | ||
* * * | ||
#### At the end of this project, I'll get : | ||
##### - Markdown README.md for the description of the present project | ||
##### - Jupyter notebook including the code, and the brain images | ||
|
||
|
||
# Results | ||
* * * | ||
#### Summary | ||
![Brief description!](https://github.com/PSY6983-2021/lgrenier_project/blob/lalou97-patch-iss1-add-bio/images/Model_description.png) | ||
|
||
### Data preparation | ||
#### - Transform all of the activation peaks of each study into a MA map with [nimare](https://nimare.readthedocs.io/en/latest/about.html).This ended up with 71 MA map, because 71 studies had been included. | ||
#### - Apply a mask to select the voxels of the grey matter. I used the [MNI152 mask](https://nilearn.github.io/modules/generated/nilearn.datasets.load_mni152_brain_mask.html) | ||
|
||
##### Here is an example of a MA maps with the mask: | ||
![Ma map example!](https://github.com/PSY6983-2021/lgrenier_project/blob/lalou97-patch-iss1-add-bio/images/MA%20map%20of%20the%20first%20study-need.png) | ||
|
||
|
||
### Machine learning | ||
##### I used a [linear support vector classification](https://scikit-learn.org/stable/modules/generated/sklearn.svm.SVC.html) to build the model. | ||
|
||
##### At first, the model classified all the data into *needs*. This problem occurred *maybe* because the value of most of the voxels is zero, or close to zero (as you can notice in the above MA map). By arranging the data in order to increase the gap between the null voxels and the non-zero ones, the classification has been improved. | ||
|
||
##### Finally, the model predicted the data with an accuracy of 83.3 ± 16.6 %. | ||
#### There are the confusion matrices that shows the results: | ||
![Confusion matrice](https://github.com/PSY6983-2021/lgrenier_project/blob/lalou97-patch-iss1-add-bio/images/Confusion%20Matrices.png) | ||
|
||
#### Interpretation | ||
##### Even if the accuracy is quite good, because the dataset contains more *needs* than *wants*, the model have initially more than 50% of accuracy if it classifies all the datas into *needs*. Therefore, we should be careful with the interpretation of that accuracy value. This also explains why the model never classifies the *needs* into *wants* and why it is only making errors by classifying the *wants* into *needs*. A solution to overcome this problem would be to balance the weight of the different conditions according to the proportions in the dataset. | ||
|
||
##### Moreover, I've split the data into training set and test set by myself with a proportion of 75% for the training set and 25% for the test set, and I've split again the training set into 60% training set and 40% validation set. Thus, the model is not optimal, because it is only learning with 45% of the initial dataset, which is quite small when having 71 datas. A cross-validation method would have been more efficient in that case. | ||
|
||
|
||
|
||
#### Features importance | ||
##### There you can see the most contributing features on the brain. The more the region is *yellow clear*, the more changes in the value of that voxel influence the decision of the model. | ||
![Feature importance](https://github.com/PSY6983-2021/lgrenier_project/blob/lalou97-patch-iss1-add-bio/images/feature_importance.gif) | ||
|
||
|
||
## Tools I learned during this project | ||
* * * | ||
###### - Python | ||
###### - Packages to run machine learning with scikit-learn | ||
###### - Packages ro run meta-analysis on python with nimare | ||
###### - Tools to create great brain images and data visualization (matplotlib, seaborn...) | ||
|
||
# Conclusion | ||
* * * | ||
##### In conclusion, the objectives of my project are mostly reach. Even if the model is not optimal and few modifications should be applied to improve it's validity, I've succeeded in building a machine learning model and in formatting the initial datas so the model can process them. | ||
|
||
##### Finally, I've started this course without a significant background in coding and a little fear about it (I admit). One of my motivation to do brainhack school was to demystify this field in order to be ready to make great neuroscience! I'm glad I did it, learned python and many useful packages to analyse and play with neuroimaging datas. | ||
|
||
##### I really want to thank BrainHack School team for their remarkable competence and exceptional support during all the course! | ||
![Thank you!](https://github.com/PSY6983-2021/lgrenier_project/blob/lalou97-patch-iss1-add-bio/images/Capture%20d%E2%80%99e%CC%81cran%2C%20le%202021-09-03%20a%CC%80%2017.18.42.png) | ||
|
||
|
||
### References | ||
* * * | ||
###### [L. Charbonnier, F. van Meer, A.M. Johnstone, D. Crabtree, W. Buosi, Y. Manios, O. Androutsos, A. Giannopoulou, M.A. Viergever, P.A.M. Smeets, Effects of hunger state on the brain responses to food cues across the life span,NeuroImage,Volume 171,2018,Pages 246-255,ISSN 1053-8119,https://doi.org/10.1016/j.neuroimage.2018.01.012.](https://neurovault.org/collections/3235/) | ||
|
||
###### [Simon B. Eickhoff, Danilo Bzdok, Angela R. Laird, Florian Kurth, Peter T. Fox, Activation likelihood estimation meta-analysis revisited, NeuroImage, Volume 59, Issue 3, 2012,Pages 2349-2361,ISSN 1053-8119, https://doi.org/10.1016/j.neuroimage.2011.09.017.](https://www.sciencedirect.com/science/article/abs/pii/S1053811911010627?via%3Dihub) | ||
|
||
###### [Assessing robustness against potential publication bias in Activation Likelihood Estimation (ALE) meta-analyses for fMRI, Acar F, Seurinck R, Eickhoff SB, Moerkerke B (2018) Assessing robustness against potential publication bias in Activation Likelihood Estimation (ALE) meta-analyses for fMRI. PLOS ONE 13(11): e0208177. https://doi.org/10.1371/journal.pone.0208177](https://journals.plos.org/plosone/article?id=10.1371/journal.pone.0208177) |
Binary file added
BIN
+18.2 MB
images/All_coordinates_Enregistrement d’écran, le 2021-09-02 à 15.32.05 (1).gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+130 KB
...tep-overview-of-the-ALE-algorithm-From-an-entire-Statistical-Parametric-Map.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
consider updating your avatar on github. This avatar is used in various places, including here, so it is less confusing if you do not use the default. It does not have to be a picture though, lots of people use cartoons and brain images in lieu of an avatar.