<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Izabela Paiva on Medium]]></title>
        <description><![CDATA[Stories by Izabela Paiva on Medium]]></description>
        <link>https://medium.com/@izabelapaiva?source=rss-bc35636ec201------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*9M6isEpWMbE13NILSQu6Hg.jpeg</url>
            <title>Stories by Izabela Paiva on Medium</title>
            <link>https://medium.com/@izabelapaiva?source=rss-bc35636ec201------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 07:05:09 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@izabelapaiva/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Classificação de tipo neuronal através da waveform de seus disparos.]]></title>
            <link>https://izabelapaiva.medium.com/classifica%C3%A7%C3%A3o-de-tipo-neuronal-atrav%C3%A9s-da-waveform-de-seus-disparos-366408a939d1?source=rss-bc35636ec201------2</link>
            <guid isPermaLink="false">https://medium.com/p/366408a939d1</guid>
            <dc:creator><![CDATA[Izabela Paiva]]></dc:creator>
            <pubDate>Sat, 19 Dec 2020 02:57:26 GMT</pubDate>
            <atom:updated>2024-10-04T09:58:22.928Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="A gamma-protocadherin mutant cortical neuron (green) superimposed on a field of wild-type cortical neurons (white). Images by" src="https://cdn-images-1.medium.com/max/420/1*VP53EPGxG6tHJx6HCYvxGA.jpeg" /></figure><h3>Neuronal type classification through the waveform.</h3><p>Authors: Izabela Lima Paiva, Lucas Caiã de Souza Tavares</p><p>Google Colab link: <a href="https://colab.research.google.com/drive/1dnsHE57sW8_iFsWyczBFU2_lIQKxeO42?usp=sharing">ttps://colab.research.google.com/drive/1dnsHE57sW8_iFsWyczBFU2_lIQKxeO42?usp=sharing</a></p><p>Electrophysiological recordings in the brain can be made at different scales, from populational activity, where the neuronal activity of a brain region is recorded, to single unit activity, where the activity of a single neuron can be recorded. Via extracellular recordings, it is possible to apply filters and matematical equations, to this data, a data known as time series, in order to identify and isolate the waveforms corresponding to the firing (activation) of individual cells, then uniting the large scales with the recording of specific brain regions with behavioral assessments it is possible to generate large datasets to support the understanding of how does brain works to process high cognitive functions such as emotional states, coordination of moviments and memories encoding. Spikings are electrical discharges considered as the main means of communication of neurons and occur in frequency ranges around 250 Hz. In the brain there are different types of neurons, presenting distinct spike characteristics. These characteristics are associated with the morphological properties of neurons, mostly due to the spatial arrangement of dendritic trees, so spikes wave-forms can be an indirect measure for classifying neuronal types.</p><p>However, this characterization is not simple. Since, as previously mentioned, through extracellular electrophysiological recordings, it is not possible to capture the activity of just one neuron, but of a group of cells. In order to enable an analysis of neuronal spikes, multiple electrodes are needed in the registered brain region, so that each spike is detected by more than one electrode close to the cell that is firing. The assignment of a spike to a given cell is then done by grouping (clustering) according to the characteristics of the waveform in captured Spikes, a process called spike sorting.</p><p>To carry out the neuron clustering process, models similar to the representative flowchart shown in Figure 1 are usually applied. However, it is difficult to classify the neuronal type of cells, since a complete confirmation is only possible by examining their morphology, something unfeasible on a medium scale. These classifications are normally made using arbitrary criteria established in the literature by visual inspection. In this work, we used the waveform characteristics of each cluster to create a classification model of pyramidal neurons and interneurons present in the rodent hippocampus.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1007/1*OqT4jTEFPg_u41A1PS7w4g.png" /></figure><p>Figure 1: The images used to build this figure can be found at: 10.1111/j.1460–9568.2009.07068.x; <a href="https://doi.org/10.1038/s41551-020-0591-0">https://doi.org/10.1038/s41551-020-0591-0</a></p><p>The hippocampus is a region of the brain that is involved in coordinating the activity of an important range of cognitive functions such as learning, memory, spatial processing, and also emotions. Pyramidal cells have a specific dendritic arborization that allows the integration of information coming from different cells, as well as sending projections to different hippocampal subregions. Therefore, they have well-defined characteristics that enable their classification.</p><p>Considering the demands to carry out the classification of neurons and the huge amount of data available, a tool capable of optimizing this process is extremely important.</p><p>For the construction of this model, we used data obtained from the online platform <a href="https://buzsakilab.nyumc.org/datasets/MizusekiK/hc-3/">https://buzsakilab.nyumc.org/datasets/MizusekiK/hc-3/.</a> The selected data were from the layer equivalents of the CA1 hippocampal region, where there is a high density of pyramidal-type neurons. After a lengthy process of cleaning and organizing the data, we were faced with the limitation of RAM in the Google Colab environment, so our analysis was limited to using a total of 84 cells and an amount of around 100,000 waveforms assigned to them (of almost 800,000). To get an idea of ​​the dimension of data included only in this repository, there are more than 3,000 cells in it</p><p>Figure 2: Waveform representative of a cluster.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/504/0*rA2TpxS2HM6DuJa-" /></figure><p>We performed the tabulation and pairing between the clusters, the waveform patterns presented by each cluster, and the classification previously performed for pyramidal cells, in Figure 2 you can see a representative waveform.</p><p>To try to take advantage of the performance of image recognition models and perform the classification of neurons from waveform characteristics, we use the Gramian Angular Field tool to convert our input signal in the form of time series to image as shown in Figure 3.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/313/0*7b57yrXFOyHQd6l-" /></figure><p>Figure 3: Gramian Angular Field calculated from the waveform shown in Figure 2</p><p>We also use the Transfer Learning technique to significantly reduce the computational cost involved with training this type of model for a large number of images. To this end, we took advantage of the weights established previously in the ResNet model, authored by Microsoft, with the exception of the last 3 layers, which were trained in our data. The implementation of the entire classification process can be seen here, in Jupyter notebook format. At the end of the analysis, the model reached an accuracy of 94.98%, which remained unchanged during the 10 training periods, suggesting problems in architecture/convergence. Seeking to improve the solution and eventually publish the results, we still need to define the best network model to be used for this problem, the architecture of free layers in transfer learning, the implementation on an HPC (High-Performance Computing) platform that allows full use of data and the training of a larger amount of epochs, the optimization of image coding via GAFs or another method and the possible implementation of a voting method to group the type predictions of each waveform into an average prediction for each cell. In conclusion, there is still a long way to go regarding the definition of the architecture and optimization of the parameters involved so that it will be possible to carry out the automated classification of neuronal types using only the waveforms of their triggers.</p><p>References</p><p>Takekawa T, Isomura Y, Fukai T. Accurate spike sorting for multi-unit recordings. Eur J Neurosci. 2010 Jan;31(2):263–72. doi: 10.1111/j.1460–9568.2009.07068.x. Epub 2010 Jan 13. PMID: 20074217;</p><p>Takekawa, T., Isomura, Y. and Fukai, T. (2010), Accurate spike sorting for multi‐unit recordings. European Journal of Neuroscience, 31: 263–272. <a href="https://doi.org/10.1111/j.1460-9568.2009.07068.x">https://doi.org/10.1111/j.1460-9568.2009.07068.x</a>;</p><p>Nason, S.R., Vaskov, A.K., Willsey, M.S. <em>et al.</em> A low-power band of neuronal spiking activity dominated by local single units improves the performance of brain–machine interfaces. <em>Nat Biomed Eng</em> 4, 973–983 (2020). <a href="https://doi.org/10.1038/s41551-020-0591-0;">https://doi.org/10.1038/s41551-020-0591-0;</a></p><p>Diba K, Buzsáki G. Hippocampal network dynamics constrain the time lag between pyramidal cells across modified environments. J Neurosci. 2008 Dec 10;28(50):13448–56. doi: 10.1523/JNEUROSCI.3824–08.2008. PMID: 19074018; PMCID: PMC2656938;</p><p>Hernan Gonzalo Rey, Carlos Pedreira, Rodrigo Quian Quiroga, Past, present and future of spike sorting techniques, Brain Research Bulletin, Volume 119, Part B, 2015, Pages 106–117, ISSN 0361–9230, <a href="https://doi.org/10.1016/j.brainresbull.2015.04.007.">https://doi.org/10.1016/j.brainresbull.2015.04.007.</a></p><p>Encoding Time Series as Images Louis de Vitry: <a href="https://medium.com/analytics-vidhya/encoding-time-series-as-images-b043becbdbf3">https://medium.com/analytics-vidhya/encoding-time-series-as-images-b043becbdbf3</a></p><p>Using ResNet for ECG time-series data, Sanne de Roever: <a href="https://towardsdatascience.com/using-resnet-for-time-series-data-4ced1f5395e3">https://towardsdatascience.com/using-resnet-for-time-series-data-4ced1f5395e3</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=366408a939d1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Classificador para crises epilépticas a partir de registros de EEG]]></title>
            <link>https://izabelapaiva.medium.com/classificador-para-crises-epil%C3%A9pticas-a-partir-de-registros-de-eeg-e2a032720f7d?source=rss-bc35636ec201------2</link>
            <guid isPermaLink="false">https://medium.com/p/e2a032720f7d</guid>
            <dc:creator><![CDATA[Izabela Paiva]]></dc:creator>
            <pubDate>Sat, 21 Nov 2020 08:42:12 GMT</pubDate>
            <atom:updated>2021-07-20T10:12:26.554Z</atom:updated>
            <content:encoded><![CDATA[<h3>Classifier for epileptic seizures from EEG records.</h3><p>Autores: Izabela Lima Paiva, Lucas Caiã de Souza Tavares</p><p>Google Colab link: <a href="https://colab.research.google.com/drive/1RqRAM_lGLkrBontfW_aQqrYu2pPYD-Lg">https://colab.research.google.com/drive/1RqRAM_lGLkrBontfW_aQqrYu2pPYD-Lg</a></p><p>Epilepsy is a highly prevalent neurological disease with strong debilitating potential. It is characterized by the generation of epileptic-type seizures. These seizures are generated through a state of synchronous neuronal hyperactivation in different regions of the brain at the same time and can result in different stages of the seizure and/or loss of consciousness. Neuronal alterations generated during epileptic seizures can be assessed by observing the oscillatory activity of the brain.</p><p>Neuronal oscillations are generated in the brain all the time as a consequence of the processes of changes in the neuron membrane and synapse potentials that occur between neurons. They are believed to be important information carriers throughout the brain and are also involved in the synchronization and activation processes of different neuronal populations. The recording of these oscillations can be performed using invasive electrophysiological techniques with the implant of electrodes in the brain tissue or non-invasive techniques such as electroencephalogram or imaging techniques, in addition to intracellular recording techniques that can be carried in animal models or cell cultures.</p><p>The electroencephalogram (EEG) is an extracellular neuronal recording technique capable of capturing the activity of cortical regions of the brain through a cap with electrodes placed adjacent to the scalp. For the investigation of epilepsy, the electroencephalogram is widely used. During EEG recordings at times of epileptic seizures, it is possible to see the appearance of peaks with altered amplitudes in the signal. From these records, several computational analyzes can be carried out analyzing parameters such as detected peak amplitudes in comparison between normal and pathological conditions.</p><p>In this work, a machine learning model was used to characterize and compare non-epileptic and epileptic conditions based on electroencephalogram records.</p><p>The data set chosen to build this model has 23 blocks, each block contains 178 data points per 1 second and each data point is the EEG record value at a different point in time. The data has five types of labels:</p><p>1 — Recording of activity at times of epileptic seizures;</p><p>2 — Recording of an area of ​​the brain with the presence of a tumor;</p><p>3 — Healthy brain region;</p><p>4 — Recording performed during moments with eyes closed;</p><p>5 — Recording performed during moments with eyes open.</p><p>The records present in classes 2, 3, 4, and 5 are of individuals who did not present epileptic seizures. While class 1 records are from individuals who had epileptic seizures. Despite the five classes present in the data in this model, a binary classification was used, where 1 is for data on epileptic seizures and 0 for data without epileptic seizures.</p><p>Exploring the data, we observe that the number of instances of class 0 (non-epileptics) is almost 4x greater than that of class 1 (epileptics), since we compile the first one, which is composed of the class compilation mentioned above. This implies two things in our model: we stratify the target column, with class labels, and we use the balanced accuracy metric to measure performance, instead of simple accuracy. Balanced accuracy takes into account the proportion of occurrences between classes.</p><p>We then chose to use a “simple” model and an ensemble model to classify the data. The simple model chosen was KNN, since previous solutions for this dataset on the Kaggle platform already emphasized its effectiveness for this problem. However, there is a common problem with using this algorithm to analyze EEG data that is known as the Curse of Dimensionality. This “curse” whose name seems to come from some spatial sci-fi movie happens when we use a clustering algorithm like KNN to classify data with a high number of dimensions, as EEG data usually is. When even neighboring points are very far from each other, classification by clustering loses its usefulness, and the more dimensions the data has, the more chances of this problem to occur. Electrical phenomena occur at very high speeds, so EEG equipment needs high sampling rates to be useful, transforming data within a few seconds can have hundreds or thousands of columns.</p><p>So how was KNN considered highly effective in previous solutions on the Kaggle platform, even with this curse haunting the data? First, because kagglers used simple accuracy as a performance metric, inflating the percentage in this unbalanced dataset, second because the curse of dimensionality itself does not decree the failure of an algorithm, it is possible that it has no significant effect on performance. The key, in this case, lies in the nature of the electrophysiological data, where the average electrical potentials in epileptic seizures contain much greater amplitude variations than in healthy patients. This is because an epileptic seizure involves electrical hyperactivation of a region of the brain, considerably increasing the recorded electrical potentials. So it is to be expected that in the vast majority of dimensions (that is, most of the time recorded in samples) there is a significant difference in epilepsy data compared to non-epileptics, which also explains the high percentages of accuracy or balanced accuracy in the models.</p><p>In the end, comparing to previous Kaggle solutions using KNN, (using balanced accuracy) we only got a small increase from 80.6% to 82.9% after using stratification, the PoweredKNN method of normalization, and “tuning” the hyperparameters using the GridSearch method.</p><p>The Random Forest ensemble method was chosen for this problem based on this literature paper (A. Chan et. al 2015) which suggests that this is the best algorithm to classify EEG data. In fact, we achieved with it balanced accuracy rates much better than those seen with KNN, in exchange for the loss of interpretability and the increase in computational cost. In the baseline model, the balanced accuracy was 93.5% while the model with adjusted hyperparameters reached 95.9%. Although the numbers are high and consequently satisfactory, it is worth mentioning that in cases with a visually evident disparity there are great chances that there are simpler and significantly less costly methods that can also do the job. A possible example would be to take the mean of the amplitude envelope and set a threshold above X deviations from a baseline (non-epileptic) record. A more difficult issue and also of greater interest in this theme would be to identify with greater spatial accuracy the microregion where the crises start, something that is not possible to do with this dataset.</p><p>References:</p><p>Acharya, U Rajendra &amp; Subbhuraam, Vinitha Sree &amp; Goutham, Swapna &amp; Martis, Roshan &amp; Suri, Jasjit. (2013). Automated EEG analysis of epilepsy: A review. Knowledge-Based Systems. 45. 147–165. 10.1016/j.knosys.2013.02.014.</p><p>Devinsky, O., Vezzani, A., O’Brien, T. et al. Epilepsy. Nat Rev Dis Primers 4, 18024 (2018). <a href="https://doi.org/10.1038/nrdp.2018.24">https://doi.org/10.1038/nrdp.2018.24</a></p><p>Buzsáki G, Watson BO. Brain rhythms and neural syntax: implications for efficient coding of cognitive content and neuropsychiatric disease. Dialogues Clin Neurosci. 2012;14(4):345–367.</p><p>A. Chan, C. E. Early, S. Subedi, Yuezhe Li and H. Lin, “Systematic analysis of machine learning algorithms on EEG data for brain state intelligence,” 2015 IEEE International Conference on Bioinformatics and Biomedicine (BIBM), Washington, DC, 2015, pp. 793–799, doi: 10.1109/BIBM.2015.7359788.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e2a032720f7d" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>