Inspiration

My main inspiration for making this project and for dedicating a lot of my time to this area of research is, in large part, its potential to help people. And because I find it cool, but mostly because it can help people. The person that inspired me to make this is actually my uncle, who, due to a seizure, has lost control over half of his body and now needs assistance with every daily task. When this happened, it occurred to me just how fragile the human brain is, and just how easy it is for it to get damaged in ways that change us forever. And with this realization came the desire to fix it. To offer medical technology a greater ability to restore brain functions in patients that have lost them, either because of seizures or other forms of nerve damage and sensory loss. Medicine used to think the human brain, was, in many ways, beyond our ability to fix due to the complexity of neural networks. However, the rise of AI can change that. The computational power Ai provides can change the game, and make interacting with neurons through inputs of current feasible option.

What it does

NeuroSim is a sandbox that allows the user to choose neuronal models and tweak parameters to their heart's content, to set targets of neuron firing times, and to watch either an evolutionary algorithm or a machine learning model do their best to find input patterns that reach said target. Essentially, given a target response, the models look for a stimulation protocol to achieve it. Where more often than not in the world of technology today we think of "reading" the brain, "reading" thoughts, the spike intervals of neurons, this application tries to advance towards "writing" to the brain, giving input to neurons in order to obtain a result. And white the scale of a single neuron is minuscule in the grand scheme of things, they are the building blocks of advanced neural network, and once we start simulating those, the real fun begins.

How we built it

The app is all built in Python, with the web facing side built entirely with the help of the streamlit framework and all graphs and plots built with matplotlib. The process of building this involved a lot of experiments, that are visible in the project files though not part of the web app. I implemented both Leaky Integrate-and-Fire and Izhikevich neuron models, including several different Izhikevich firing behaviors. To solve the inverse problem, I built an evolutionary search algorithm that improves stimulation patterns using selection, crossover, mutation, and continued random exploration. I then added a Random Forest surrogate model that learns from previous simulations. It ranks newly generated stimulation candidates so that the optimizer can prioritize promising ones before running the full neuron simulation.

Challenges we ran into

One of the biggest challenges was that finding a stimulation pattern is easy compared with finding the right one. Early random search worked occasionally, but became unreliable as targets became more difficult. Our first evolutionary approach also tended to get stuck. Strong early candidates would dominate the population before the search had discovered all the pieces of a good solution. Adding crossover and a constant influx of random candidates to the population through the generations helped stop the algorithm form hyper fixating on a particular set of genes that worked somewhat but not entirely. Even the improved algorithm tended to mess up with more complex targets, and so I added a simple ML model to estimate candidate potential, so that more candidates could be sorted through in order to find the right pattern to achieve the target.

Accomplishments that we're proud of

What I'm most proud of is that the simulator has achieved the task I set out to solve with it, far more efficiently than I expected. The evolutionary optimizer can discover stimulation protocols for target neural responses across different neuron models, and the ML surrogate demonstrated that it could meaningfully identify promising untested candidates. In testing, ML-selected candidates had substantially higher real fitness on average than the overall candidate pool. I'm also proud that the final ML system does not replace the neuroscience simulation. Machine learning decides what looks worth trying, while the neuron simulator still decides whether a stimulation pattern actually works.

What we learned

I learned how to use matplotlib to plot the results of my experiments in order to extract the most information from them, And to use that information in conducting more complex experiments and improve upon the old frameworks. I also learned how to optimize an evolutionary algorithm step by step, starting from something really simple ands ending up with something that looks an awful lot like real biological evolution. Lastly I'm happy with the progress I made learning how to train a machine learning model and having it assist the evolutionary project dynamically.

What's next for NeuroSim

For now, NeuroSim works with simplified single-neuron models, but the same basic idea could be explored at much greater scale. Future versions could investigate networks of neurons, more realistic stimulation methods, biological data, spatial stimulation, and more advanced ML-guided search. The long-term question behind NeuroSim remains the same: if we can describe the neural activity we want, how can computation help us discover how to produce it?

Built With

Share this project:

Updates

Submission history