This repository contains the files of my master's research project in computational intelligence.
The project is a research on the synchronization analysis of biological neuron models. The ideia is to analyze the possibility of trajectories segmentation by synchronizing a group of neurons with strong coupling force between each one and the dessynchronization of those by a weak coupling force. Finally, a proof of concept is created as a machine learning model of semi-supervised learning, thus representing samples with the same classification by a cluster of synchronized neurons, and the samples with different labels are dessynchronized.
masters-project
|
|---- data
|---- imgs
|---- nsc
|---- tests
The data folder contain the raw and cleaned datasets used to test the semi-supervised learning model, as much as the scores obtained by testing the model with different parameters combinations.
The imgs folder contain the three images used in the README.md file. The nsc package, which is an abbreviation for Neuron Synchronization Competition, contain the python files for the model of semi-supervised learning (neurongraph.py), while it contain others files that calculates the phases of the trajectories to detect the synchronization (unwrap.py), the file to plot some specific kinds of graphics (ngplot.py), different models of self-training (standard_self_training.py) and tri-training (tri_training.py), etc.
Also there is the neuron subdirectory that contains the biological neuron models defined below:
- Hodgkin-Huxley
- Hindmarsh-Rose
- Integrate-and-Fire
- Rulkov
- Izhikevich
- Courbage-Nekorkin-Vdovin
Finally, the tests folder contain all the steps made in the project and the figures obtained as the results. Some subdirectories, specifically the last one, must be updated, which will be in a recent future.
At this last folder (11 - NSC Data Tests), from the tests directory, there is a folder called Notebooks which contains the jupyter notebooks of the exploratory data analysis and cleaning processes of the datasets used for machine learning models comparison.
The implementation of the NSC model is quite simple. Down below there is an example of the implementation, where you import the NSC class, then you instantiate it with some values as the data to be inserted (must be a Pandas DataFrame), the target name, similarity used (like euclidean distance), model to indicate the neuron model, alpha, beta and gamma are parameters used to adapt the coupling force. The w_step means the maximum/minimum value of the coupling force adaptation, neighbors are the maximum amountof connections a neuron can make, search_expand represents the speed at which the searchs' hypersphere grows. Finally, print_info and print_steps, prints the classified data and all the steps of the agorithm, respectively.
Then we use the preprocess_data method to clean our dataset, and finally we fit the model to the dataset by inserting the number of epochs and the data_dtype respective to the similarity used, as this case is 'Euclidean', then the data must be the argument NSC.numerical, in case is a similarity for categorical data, then use the argument NSC.categorical, these arguments are pieces of the dataset data that were sliced by the preprocess_data method.
from nsc import NSC
import pandas as pd
iris = datasets.load_iris(as_frame=True).frame
model = 'CNV' # CNV stands for Courbage-Nekorkin-Vdovin
nc = NeuronGraph(data=data, target='target',similarity='Euclidean', model=model, alpha = 0.1, w_step = 0.2, time_step=1, print_info=False, print_steps=False, beta=2.0, gamma=1.5)
nc.neighbors = 15
nc.search_expand = 100
nc.preprocess_data(shuffle=False,not_null=10, standarlize=False) # not_null arg selects 10 data points to be classified, and all others the target are set to null
nc.fit(epochs=1000, nc.numerical)
print(nc.score)
The first figure represents the decision limits generated by the adjusted model, while the second image shows the action potential of the neurons of the 150 samples, and we can see the clustering phenomenon by segmenting the trajectories in time in the third image, which represents the times when neural firing occurs.
Hodgkin, A. L., & Huxley, A. F. (1952). A quantitative description of membrane current and its application to conduction and excitation in nerve. The Journal of physiology, 117(4), 500-544.
Hindmarsh, J. L. and Rose, R. (1984). A model of neuronal bursting using three coupled
first order differential equations. Proceedings of the Royal society of London. Series B.
Biological sciences, 221(1222):87–102.
Lapicque, L. (1907). Recherches quantitatives sur l’excitation electrique des nerfs
traitee comme une polarization. Journal de Physiologie et de Pathologie Generalej,
9:620–635.
Rulkov, N. F. (2002). Modeling of spiking-bursting neural behavior using twodimensional
map. Physical Review E, 65(4):041922.
Izhikevich, E. M. (2003). Simple model of spiking neurons. IEEE Transactions on
neural networks, 14(6):1569–1572.
Courbage, M., Nekorkin, V., and Vdovin, L. (2007). Chaotic oscillations in a map-based model of neural activity. Chaos: An Interdisciplinary Journal of Nonlinear Science, 17(4):043109.