Using Connectomics and Artificial Intelligence to Diagnose Schizophrenia

How I used fMRI data to create a schizophrenia machine learning diagnostic method and find functional biomarkers of schizophrenia

Imagine this: it’s morning, and you just woke up to a loud noise. Thinking it’s your alarm clock, you try to turn it off, but it hasn’t gone off yet. Where is the noise coming from? Confused, you get out of bed and search for the source. Your heart starts beating faster and faster, and you feel like you’re trapped. A man puts his hand on your shoulder and greets you from behind. He is after you. You scream and turn around, but there is no man there… No one is there.

It sounds like a nightmare, but for 3.2 million people in the US, a terrifying scenario like this is a reality.

I recommend watching this for a better understanding of my project

Schizophrenia is a chronic mental disorder that affects every 1 in 100 people. Symptoms vary from person to person, but usually start between the ages of 16 and 30. Symptoms include:

  • Delusions (false beliefs)
  • Hallucinations (can be auditory or visual)
  • Disorganized thinking (speech)
  • Thoughts of harming oneself or others
  • Abnormal motor behavior
  • Depression

The most widely cited lifetime suicide rate of schizophrenia is 10%. Schizophrenia not only affects the person with it, but also their friends and family

However, based on the “obvious” symptoms, it sounds like a pretty easy disorder to diagnose, right?…


In fact, the way we’re currently diagnosing schizophrenia, along with all other mental disorders, is wrong. Our diagnostic methods for mental disorders make no sense. Michelle Hammer, the advocate in the video above, was incorrectly diagnosed with bipolar disorder for 4 years. She is not alone.

This is because our current diagnostic methods are solely based on symptoms. And not to mention, being treated for the incorrect mental disorder can be very harmful and make symptoms worse.

The problem is that we’re failing to address the root cause of mental disorders: the brain.

And this doesn’t just go for schizophrenia. For me personally it was my OCD, which I was correctly diagnosed with after 8 long-lasting years of panic attacks, intrusive thoughts, and compulsions.

By focusing our studies of these disorders on the brain, we can not only gain new insights on the biological causes, but even create targeted treatments and destigmatize mental illness.

Considering that schizophrenia increases death risk 2.8-fold in males and 2.5-fold in females, we need a method of studying the brain that is deployable, scalable, and valuable, and we need it quick. This is why I’ve been super passionate about a new and emerging field of neuroscience, functional connectomics.

Functional connectomics is a novel way of studying the brain. Rather than looking at how all of the neurons in our brain are structurally connected, functional connectomics looks at how different regions of the brain are functionally connected (i.e. the correlation between different parcellated voxels, or nodes, of the brain).

We can gather functional data of the brain using a lot of different methods, but the one most commonly used to date is functional magnetic resonance imaging (fMRI).

When different parts of the brain are activated, they are provided with more energy by adjacent capillaries through a process called the hemodynamic response. This supplies the region with increased cerebral blood flow and an increase in oxygen supply.

This process results in a change in terms of the relative levels of oxyhemoglobin and deoxyhemoglobin that can be detected by MR imaging. This imaging approach is called blood oxygen level–dependent (BOLD) contrast imaging. The change in the BOLD signal is the cornerstone of functional MR imaging.

When different parts of the brain are more active than others, more blood goes to that part of the brain which can be detected with an fMRI scan. This technique can be used to study which parts of the brain are activated during specific tasks.

Several preliminary studies have shown that there may be functional differences between healthy controls and schizophrenic patients in the resting-state, or when the subject is not completing a specific task (i.e. no external stimulus).

Functional integration analysis of resting-state fMRI time series (A and D) → functional connectome

I looked further into this by computing a functional integration analysis of resting-state fMRI time series, or looking at how different parcellated brain regions, represented by nodes in a graph, are correlated with each other, represented by edges, called a static graph analysis. I compared the results of this between 40 controls and 40 schizophrenics, the data provided by the UCLA Consortium for Neuropsychiatric Phenomics, looking for potential biomarkers of schizophrenia. I used the Harvard-Oxford atlas to define more than 100 nodes in the brain to measure the BOLD signal of.

I computed the functional integration analysis using the CONN toolbox, a MATLAB-based cross-platform software for the computation, display, and analysis of functional connectivity in fMRI time series.

The first step in the process is uploading the anatomical and functional data of each subject into CONN.

The CONN GUI. This screenshot shows the functional data I loaded in of Subject 1, a healthy control. Right now, the data are not very useful as it has not been preprocessed, denoised, or analyzed.

After I loaded in all of the functional and structural data of each subject, I used CONN to preprocess the fMRI time series of each subject. Putting it simply, this means putting the data through a filter, so it’s a little bit easier to do analyses on the data.

The preprocessing pipeline I used

There are 4 major steps in the preprocessing process we’ll focus on, the first being slice timing correction.

Slice timing correction

An fMRI doesn’t actually look at different parts of the brain all at once; it images the brain in slices, and a brief amount of time goes by between each slice reading.

In slice timing correction, we’re attempting to make all the slices in a volume appear as though they were “imaged simultaneously.” I used the ascending direction for slice timing correction, or acquiring the slices from the negative direction to the positive direction.

Motion and distortion correction

Motion correction is arguably the most important step in the preprocessing pipeline.

When a subject is in a scanner, they may move around a bit which means some of the pictures may shift. We therefore have to realign all of the images.

And in the registration step of preprocessing, we align the functional and anatomical data to a template. By doing so, we can compare fMRI results across multiple studies.


Last but not least is smoothing, in which we take the average of a particular voxel and all of its neighbors, thereby “smoothing” the data, kind of like image interpolation.

The amount of neighboring voxels you average depends on your smoothing kernel, which can vary from study to study. The data I used recommended a smoothing kernel of 5.

Luckily, I did not have to manually do this for each subject, as CONN abstracts the process, as well as the denoising process in which noise is removed from BOLD signaling. However, understanding the steps is important in picking the right parameters in each step.

Screenshot from CONN after preprocessing and denoising

The screenshot above is the result after preprocessing and denoising. As can be seen in the top left, the distribution of connectivity values has been transformed to align the maximum with 0, preventing a positive skew of my data.

The connectivity value was calculated between each node in the brain defined by the Harvard-Oxford atlas I used.

I found the BOLD signal for each ROI (dots in the brain on the left) in CONN by averaging the BOLD signal from every voxel, or tiny cube of neurons, in the particular ROI.

Then, I calculated the correlation between every possible pair of ROIs via cross correlation analysis:

Var(x) and Var(y) are the variances of two BOLD time series, Fx(k) and Fy(k). Covx,y(μ) = E {((Fx(k)−E(Fx)) * ((Fy(k)−E(Fy))}, in which E is the expected value. What you need to know is if Corrx,y(μ) is above a certain threshold, we consider that the two BOLD time courses Fx(k) and Fy(k) are functionally connected (to some degree).

The correlation values (found using the equation above) are then averaged across each group individually.

In CONN, I then looked at which connections were significantly different between brain regions of healthy controls and schizophrenics (p<0.05). Gender and age were added as second-level covariates in the analysis and showed no significant effect on the results.

Results and Discussion

Screenshot from CONN

The functional connectome ring above depicts resting-state hypoconnective (decreased in connectivity) connections in the schizophrenic brain, or which connections are significantly greater (indicated by the red line) in healthy controls. It can be seen that there is decreased connectivity between the node in the cerebellum and the inferior frontal gyrus.

This is particularly interesting, as the inferior frontal gyrus plays a role in speech processing, and the cerebellum coordinates speech. Logically, this makes sense, as a hallmark symptom of schizophrenia is disorganized speech along with decreased processing speed.

Additionally, I found that there was a decrease in the functional connectivity in schizophrenics between a pair of nodes in the default mode network (DMN), the network active when one has self-referential thoughts, and the cerebellum. Several past studies have also found abnormalities in the DMN resting-state functional connectivity.

The role of the cerebellum in schizophrenia has been highlighted in Andreasen’s hypothesis of “cognitive dysmetria,” which suggests a general discoordination of sensorimotor and mental processes in schizophrenia.

Past functional neuroimaging studies have correlated poor cognitive performances with abnormal cerebellar activations, although it is unclear whether or not it is the result of hypoconnectivity or hyperconnectivity. In the case of the DMN and cerebellum in my results, it was hypoconnectivity.

Screenshot from CONN

I also found that in schizophrenics, depicted above, there was decreased connectivity between another node in the cerebellum and inferior frontal gyrus, further supporting the results above.

After further investigating the connections, I found that there were hyperconnectivites in schizophrenics compared to controls.

Screenshot from CONN

When looking at a node in the lateral visual network of the schizophrenic group, I found that it had increased connectivity with several other nodes. A red line indicates a very intense connection, as an orange line represents a still high, but not as intense connection.

Screenshot from CONN

When looking at a node in the cerebellar vermis, the part of the cerebellum that controls the timing and pattern of muscle activation during movement, I found increased connectivity in schizophrenics between several nodes. This aligns with previous studies in which the vermis volume was greater in schizophrenics than healthy controls, although contradicting other studies.

Finding functional biomarkers of not only schizophrenia, but also other mental disorders with this technique, holds promise in aiding in the diagnosis as well as targeted treatment of these disorders.

However, it is also important to note that schizophrenia is a heterogenous disease, meaning it is very diverse, which is why I have created a neural network to diagnose schizophrenia based on the data I have gathered.

First, I preprocessed and analyzed resting-state fMRI data with the method described in this article. In addition to the 30 patients and 30 controls in the data I collected above, I repeated the same process for 50 more patients and 50 more controls, a total of 160 subjects and found the significant differences between groups. I used these significant differences as inputs into my simple artificial neural network (ANN).

An ANN, inspired by biological neurons, takes in an input(s) and returns a desired output.

A simple feedforward neural network

The feedforward neural network takes in inputs, which then go through a series of hidden layers to produce an output. Each node represents a neuron, as each edge represents a weight which the input is multiplied by.

Each input, x, is multiplied by its corresponding weight, w. The summation of this is calculated and the bias, b, is added. The output is then found by multiplying the summation by the activation function.

I used the sigmoid activation function, which turns the output into a value between 0 and 1.

The sigmoid activation function, in which e is Euler’s number and x is the summation

If the output is ≥ 0.5, the patient is predicted to be schizophrenic, as if the value is < 0.5, the patient is predicted to be healthy.

After inputting the connectivity values of each subject into a CSV file, I coded the neural network in Python.

The data is first randomly divided into training data and testing data, 20% of the training data.

Screenshot of my code

I then divided the data into features and targets. The features are the inputs of the neural network, while the targets are what the neural network should predict as the output (i.e. a 0 if the features inputed are of a healthy control, or a 1 if the patient is schizophrenic).

Screenshot of my code

I am now able to train the neural network, but first must code the helper functions needed in the training process, including the sigmoid activation function, sigmoid prime, error formula, and error term formula defined by (𝑦−𝑦̂ )𝜎′(𝑥), in which 𝑦̂ is the predicted value, y is the actual value, and 𝜎′ is sigmoid prime. This is used in back propagation, in which we adjust our weights based on how large our prediction error is.

Screenshot of my code

I set the epochs, or the amount of time the neural network is presented the data with, to 100. The learning rate is 0.5, which controls how much the model changes in response to the estimated error each time the model weights are updated. It is used in stochastic gradient descent, a process necessary in backpropagation to make the model perform better.

Screenshot of my code

In summary, the train_nn function below guesses if the patient is schizophrenic or a healthy control based on the connectivity values of each patient. The error is then calculated using the error term and error term formula defined above. The weights are then changed using stochastic gradient descent to make the neural network more accurate the next time data is inputted, meaning the loss (I used the mean squared error) should be decreasing overtime.

Screenshot of my code

Now, the neural network is ready to be tested using the code below.

Screenshot of my code

After running the code, I found that the neural network was able to correctly diagnose schizophrenia based on the functional connectome 75% of the time. This means that only 25% of the patients were misdiagnosed, which is much better compared to the study that found 54% of people referred to the clinic with a schizophrenia diagnosis did not actually have schizophrenia.

I’m currently experimenting with different neural architectures to increase the accuracy, as well as collecting more data, including data from different studies, to make the algorithm more generalizable. The next steps of the project are making the inputs multi-phenotypic, incorporating genetic data along with behavioral symptoms. I plan on expanding the neural network to have the ability to predict a variety of neurological and psychiatric disorders.

Not only does this have the potential to make earlier diagnoses and more accurate diagnoses, but it also holds the potential to end the stigma surrounding mental illness.

This is shocking. However, by gaining a better scientific understanding of these mental disorders, this could potentially end the stigma and create a brighter future for the 450 million people suffering from mental illness worldwide.

If you’d like to hear more about this, listen to the podcast I was on in the link below, or read my article on neural plasticity and psychedelics here!

I couldn’t get this picture to be smaller… sorry, hehe

Hey y’all! 👋 I’m Mikey, a 16-year-old who’s super passionate about the intersection between exponential technologies and neuroscience. My goal is to revolutionize diagnosis and treatment of neurological and psychiatric disorders. However, I’m pretty much interested in everything. Shoot me an email at if you would like to further discuss this article, or just chat!

machine learning and neurotechnology developer and researcher.

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store