GSoC 2025 Project #7 Brian Simulator :: Brian2Wasm: simulations in the browser (175/350h)

Mentors: Dan Goodman <d.goodman@imperial.ac.uk>, Marcel Stimberg <marcel.stimberg@inserm.fr>, Benjamin Evans <B.D.Evans@sussex.ac.uk>

Skill level: Novice/intermediate

Required skills: HTML, JavaScript, basic C++ and Python

Time commitment: Flexible (175/350 hours)

Forum for discussion

About: Brian is a clock-driven spiking neural network simulator that is easy to learn, highly flexible, and simple to extend. Written in Python, it allows users to describe and run arbitrary neural and synaptic models without needing to write code in any other programming language. It is built on a code-generation framework that transforms model descriptions into efficient low-level code. WebAssembly is a binary instruction format for a stack-based virtual machine. Wasm is designed as a portable compilation target for programming languages, enabling deployment on the web.

Brian’s code generation pipeline can generate C++ code, and the emscripten toolchain can compile this code into WebAssembly. This makes it possible to run simulations directly in a web browser, requiring no installation on the client side. We have recently created a proof-of-concept, brian2wasm (GitHub - brian-team/brian2wasm), showing the feasibility of this approach.

Aims: The aim of this project is to turn this proof-of-concept into a convenient tool for the wider community. In particular, the aims of this project are to:

  • Improve the general workflow (e.g. detection/configuration of emscripten toolchain)
  • Implement efficient data transfer between the WebAssembly simulation and the JavaScript code that displays the results
  • Provide convenient tools for website customization and plot display
  • Document the package and its usage

Additional goals for a 350h project:

  • Set up an automatic test suite for brian2wasm
  • Provide convenient tools for setting parameters at the start of the simulation (big project)
  • Provide components for real-time interaction with Brian scripts, e.g. providing microphone or camera input to the Brian simulation and returning spikes or other data from the Brian simulation to the website (big project)

Project website: GitHub - brian-team/brian2wasm

Tech keywords: HTML, JavaScript, WebAssembly, emscripten, Python, C++

2 Likes

@d.goodman , @mstimberg , and @benjamin_evans

I am very interested in the brian2wasm project. The aims of the project, particularly improving the workflow and implementing efficient data transfer, align with my skills and interests. I have experience with HTML, JavaScript, and basic C++ and Python, and I’m eager to learn more about WebAssembly and emscripten.

I have reviewed the brian2wasm repository and I am excited by the potential of this project. I am available to commit [175/350] hours to this project, and I am confident that I can make a meaningful contribution.

I would welcome the opportunity to discuss my application and the project in more detail.

Thank you for your time and consideration.

Sincerely,

Vrushali

Dear @d.goodman, @mstimberg I hope you are doing well. My name is Sayan, and I am an AI Researcher at Jadavpur University and ex-Research Intern at IIEST with a strong background in Python, JavaScript, HTML, and basic C++. I am particularly interested in computational neuroscience and its applications in neural network simulations.

I came across the Brian2Wasm project for Google Summer of Code 2025 and found it highly fascinating. The idea of bringing Brian 2 simulations to the web using WebAssembly is an exciting challenge, and I would love to contribute to improving the workflow, optimizing data transfer, and enhancing visualization tools. Given my experience in machine learning, deep learning, and frontend development, I believe I can add value to the project.

I would appreciate any guidance on getting started. I have reviewed the brian2wasm repository and would love to discuss potential contributions, initial tasks, or any prerequisites you recommend. Please let me know if we can set up a call or if there are specific areas where I can begin contributing.

Looking forward to your response!

Hi @Sayan_Mandal1, hi @vrun. Thank you for the interest in our project! I am currently travelling and can not get into details at this time, but I will be back in the office coming Monday and will give you more information then. Until then, you can find some very general information on the website we put up for last year’s GSoC: GSoC 2024 | The Brian spiking neural network simulator The 2024 discussions on neurostars (links in the page linked above) should also give you some ideas. Apologies for not being more precise for now, but I’ll get back to you early next week.

Best,
Marcel

Hi @mstimberg,

Thank you for your response! I appreciate the pointers and will go through the GSoC 2024 page and Neurostars discussions in the meantime. Looking forward to your update next week.

Best,
Sayan

Dear @mstimberg,

I hope you are doing well. My name is Vinayak Kashyap, and I am a BTech student in Computer Science and Engineering at Indus University, India. I am highly interested in contributing to the Brian2Wasm project as part of GSoC and would love to learn more about how I can get involved.

I have experience in C++, Python, and the MERN stack, along with a understanding of Spiking Neural Networks (SNNs), Artificial neural networks (ANNs) and deep learning. I have worked with PyTorch for model development and have previously built a similar project using simpler machine learning models and smaller neural networks for linear regression. My experience with both web development and neural network simulations aligns well with the goals of Brian2Wasm, especially in integrating WebAssembly with Python-based neural network modeling.

I would like to understand more about the user interface design for this project. Will users write their Python code in a built-in code editor in the browser, or will they upload Python files for execution? Additionally, do you envision an interface where users can only modify simulation parameters interactively (similar to the LIF neuron simulation I implemented in a Python Colab notebook with widgets), or should it support both parameter tuning and custom code execution? Clarifying this would help me plan my contributions more effectively.

example:

I am eager to contribute, learn, and collaborate with the community. Please let me know how I can get started and any specific areas where contributions are most needed. Looking forward to your guidance!

Best regards,
Vinayak Kashyap

Hi everyone,
Thanks again everyone for your interest in the project. As I promised last week, here is some more information about the application process and about what we expect from you – I will answer the specific questions you had in separate messages. Here’s a general write-up about the application process and what we would like to see in your application: GSoC 2025 | The Brian spiking neural network simulator

For the brian2wasm project specifically, I’d like you to include two more things:

  1. A write-up of the steps you took to run the examples from the brian2wasm repository (dependency installation, emsdk setup, etc.). In case that you ran into any issues, what these issues were and how you overcame them.
  2. Please provide a new example, consiting of a .py and a .html file, as a pull request to the brian2wasm directory. This could simply be a different example network (e.g. from Examples — Brian 2 2.8.0.4 documentation), a different presentation of the results in the HTML page (see brian2wasm/examples/brunel_hakim1999_style.html at main · brian-team/brian2wasm · GitHub for the general approach), or a different way of setting parameters at the start of a simulation (see brian2wasm/examples/brunel_hakim1999_change_params.html at main · brian-team/brian2wasm · GitHub for one example), or a mix of all of them or something else entirely :slight_smile:

Obviously, please do not hesitate to ask in case anything is unclear.

Good questions, it is always a bit tricky to exactly convey the “niche” we want to fill with brian2wasm. The brian2wasm project is not meant to provide a way to interactively upload or edit code for a model in the browser. For this, you’d either have to have a running server (like Colab provides) or use something like jupyter-lite or pyodide which is comparatively slow. Instead, our target audience would be researchers that have created a Brian2 model and want to share this specific model with the community (e.g. alongside a publication). With brian2wasm, they can use the same code they used for their research and can quickly turn it into a HTML page that can run their model, without the need for a server (since the code runs in the client’s browser), so it can be hosted on a simple web hoster such as github pages. By customizing their HTML page, they can alllow visitors to try out different parameters, or even (this would be related to the goals of the “full-time” project) upload their own inputs or use input from the webcam or the microphone. So in sum, the aim is to enable researchers to provide demos, like you sometimes see in the ML community (e.g. see the IPOL journal: IPOL Journal · Image Processing On Line), but 1) for Brian2 models and 2) without needing to provide a server infrastructure (as IPOL does).

Hope that clears things up a bit?

Thank you @mstimberg for your response. Based on my understanding, we are going to use emscripten toolchain that converts Brian2 model code into WebAssembly along with a JavaScript wrapper. This will allow researchers to compile their Brian2 models into a web-compatible format and upload them to a website. Other users can then modify model parameters and test different configurations directly in their browser.

Currently, Brian2 supports C++ code generation using set_device('cpp_standalone'). My task is to implement a similar approach, something like wasm_standalone, which would first convert the model into C++ and then use Emscripten to compile it into a .wasm file along with a .js wrapper. This would enable researchers to easily share interactive model demonstrations without requiring server infrastructure.

Does this align with the intended goals of the project? Looking forward to your feedback.

Yes, exactly, except for the fact that the wasm_standalone device already exists in the brian2wasm repository :blush: This project is (at least for the 175h “part-time project”) mostly about polishing/testing/documenting the existing code and writing convenience functions (mostly on the JavaScript side) to make this tool easy and pleasant to use.

So my role will be:

:one: Improving the toolchain workflow – Enhancing the detection and configuration of the Emscripten toolchain, ensuring smooth installation, and improving error handling.
:two: Optimizing data transfer – Making WebAssembly-JavaScript communication more efficient for better performance, particularly for large-scale neural models.
:three: Enhancing usability – Developing JavaScript wrapper functions and UI components that allow users to interactively modify model parameters and visualize results in real-time.
:four: Testing and documentation – Writing clear usage guides, tutorials, and improving test coverage to make brian2wasm more accessible to researchers.

Additionally, I plan to develop a working prototype within the next 10 days to demonstrate the initial improvements and validate the approach. This will help identify key areas that require further optimization and refinement.

Looking forward to your guidance as I begin working on this.

Dear d.goodman, mstimberg, benjamin_evans,

I hope you are doing well. My name is Aryan Pachchigar, and I am excited about the opportunity to contribute to the Brian2Wasm project as part of GSoC 2025.

I am particularly interested in frontend development like as I am good in React and would love to help improve the visualization and interactivity aspects of Brian2Wasm. Additionally, I am open to contributing to the backend if needed. While I am still a novice in this domain, I am eager to learn and contribute effectively.

I have reviewed the project goals and the brian2wasm repository, and I find the idea of running Brian2 simulations directly in the browser fascinating. I would appreciate any guidance on getting started, such as specific areas where contributions are most needed and initial tasks I can work on.

Looking forward to your response and the opportunity to collaborate with the community.

Best regards,
Aryan Pachchigar

hiii @mstimberg i am interested in this project it looks fun & what you guys are doing is exciting, for the part-time 175 hours is that primarily just brushing up its UI/UX and less backend?

Hi @anaya-yorke thanks for your interest in our project. I’d say it’s a bit more than just UI/UX work, since the documentation and improvement of the emscripten workflow would be a main goal. But a large part would indeed be related to the interface, either by directly providing JavaScript function for certain tasks, or by writing Python functions and HTML templates to generate code snippets that will be integrated into the generated website.

Hello @mstimberg this project looks really exciting, and I’d love to contribute to it for GSoC 2025! I’m an intermediate developer with experience in HTML, JavaScript, and some Python and C++, and I’m eager to help make this tool more user-friendly for the community.

I’ve started exploring the repository and plan to run the examples soon. I’d love to hear your thoughts on what skills or contributions would be most valuable for a GSoC contributor to this project.
Looking forward to your insights!

Hi @Ankur. Glad to hear that you are interested in the project. Note that the submission deadline is already in about a week, so there is not a lot of time to prepare a proposal. For some requests/recommendations specific to the Brian2Wasm project, see my earlier post in this thread, and for general recommendations and explanations of the GSoC application process, please refer to the post on our website. Don’t hesitate to contact us in case you have other questions, of course.

Thank you for your response and guidance
I’ll begin working on my proposal soon, incorporating your recommendations from the earlier post and the GSoC guidelines on the Brian website. I’ve already started setting up the environment to run the examples and will include a write-up along with a new example as a pull request, as you suggested.

If I run into any specific questions, I’ll reach out, but my goal is to submit everything well before the deadline next week.

Hello @mstimberg , @d.goodman and @benjamin_evans,

I’m Alfiya Fatima, a Junior Engineering student from Dayananda Sagar College of Engineering, Bangalore, India. I’m interested in web technologies, open-source contributions, and building tools that make science and education more accessible.

I’ve recently started contributing to the Brian2Wasm project, and it’s been an exciting learning journey so far.

I’m preparing a proposal for Google Summer of Code 2025, and I’m really enthusiastic about continuing my work on this project.

Also, @mstimberg , I would like to get confirmation on how I could get the draft proposal reviewed. Could you please confirm on this ?

:alarm_clock: Dear students/open source beginners interested in the “Brian2Wasm: simulations in the browser” project, please don’t forget that the deadline for applications on https://summerofcode.withgoogle.com is later today at 18:00 UTC, i.e. in about 5 hours. Note that it will be impossible for us to ask Google to finance an internship for a candidate that did not submit an application, and that there will be no extension of this deadline from Google’s side. Good luck everyone, hope to see a few of you staying around (with or without a GSoC internship) :crossed_fingers: