Lucca skyline ASCII art

BrainHack Lucca 2025

2 - 5 December 2025

BrainHack Lucca

%d

Days

%h

Hours

%m

Minutes

%s

Seconds



About BraianHack Lucca

Open science and open data

The purpose of Brainhack is to bridge the data science and neuroscience research communities to advance the progress of brain science research. This collaborative workshop brings researchers from across the globe and different disciplines to work together on innovative projects related to neuroscience combining elements of Hackathons, with a variety of educational activities. Year after year, global Brainhack events have brought together researchers to participate in open collaboration and regional Brainhack events keep the momentum going throughout the year.

Read the BH code of conduct

BrainHack Global

The world-wide organization that helps with the organization of local events

The BrainHack Lucca celebrates inclusivity, promotes cooperation over competition, and upholds the ethical principles of international humanitarian law.
As such, BrainHack Lucca firmly rejects all ongoing wars and acts of genocide.

Program

IMPORTANT NOTICE: we recorded a short video on how to write an efficient project for the BrainHack.
You can find the link to the video in the heading of the Projects section

You can find the complete BrainHack Lucca program here.
The first day is dedicated to teaching, with training sessions on different open science tools.
The following days will be focused on collaborative working (hacking sessions).

This year we will have two parallel sessions on day one morning! Choose wisely!

Program in progress!

Welcoming, coffee and delicacies

Registration and breakfast

Badges at IMT school and coffee at 'La Pecora Nera'

Ruggero Basanisi

Introduction to BrainHack

Ruggero Basanisi (IMT, Lucca)

Introduction to BrainHack Lucca 2025

BASIC

ADVANCED

Alessandro Betti

Training: Python basics

Alessandro Betti (IMT, Lucca)

Brief Introduction to Python

Chiara Battaglini

Representational Similarity Analysis HackLab

Chiara Battaglini (IUSS, Pavia)

Hacking the brain’s inner map: from stimuli to individual patterns

Alessandro Betti

Training: Going on with Python

Alessandro Betti (IMT, Lucca)

Start programming with Python

Miguel Ibanez Berganza

Inferring Correlation and Causation

Miguel Ibanez Berganza

Inferring correlations, partial correlations, and higher-order interactions

Matteo Lionello

Training: Git & GitHub

Matteo Lionello (IMT, Lucca)

How and why using Version Control Systems

Monica Paoletti

Inference Methods for Virtual Brain Models

Monica Paoletti (SISSA, Trieste)

Transitioning from Simulation-Based Inference to Bayesian Inference

INTERMEDIATE

Hosted in Cappella Guinigi

Vittorio Iacovella

FAIR enough

Vittorio Iacovella (UniTrento, Trento)

Fine-tuning your research outputs to foster reproducibility

Buon Appetito

Lunch Break

Lunch will be served at IMT canteen

Anna Molino

Empowering Researchers

Anna Molino (IMT, Lucca)

How Academic Institutions Can Support Open Access Publishing

Anna Pirri Valentini

Copyright, Copyleft, and Open Source

Anna Pirri Valentini (IMT, Lucca)

Exploring Regulatory Challenges in the Age of Artificial Intelligence

COFFEEEEEE

Coffee Break

Coffee Break will be served at 'La Pecora Nera'

Marta Bortoletto

From pre-registration to world-wide collaborative projects

Marta Bortoletto (IMT, Lucca)

Everything You Always Wanted to Know About Open Science* (*But Were Afraid to Ask)

Projects' Presentation

Projects pitches - Projects leaders

Short presentations of the available projects

Party!

Social Night Event - All the Brainhackers

The social night event will be hosted in IMT school

Breakfast

Breakfast

Breakfast will be served at 'La Pecora Nera'

Hack those brains!

Hacking session - Working groups

Collective work on projects!

Buon Appetito

Lunch Break

Lunch will be served at IMT canteen

Hack those brains!

Hacking session - Working groups

Collective work on projects!

COFFEEEEEE!

Coffee Break

Coffee Break will be served at 'La Pecora Nera'

Hack those brains!

Hacking session - Working groups

Collective work on projects!

Daniele Marinazzo

Connectivity and dynamics

Daniele Marinazzo (Universiteit Gent, Ghent)

Surprise and variance reduction

Breakfast

Breakfast

Breakfast will be served at 'La Pecora Nera'

Hack those brains!

Hacking session - Working groups

Collective work on projects!

Buon Appetito

Lunch Break

Lunch will be served at IMT canteen

Hack those brains!

Hacking session - Group Work

Collective work on projects!

COFFEEEEEE!

Coffee Break

Coffee Break will be served at 'La Pecora Nera'

Chiara Barattieri di San Pietro

NLP meets the Clinic

Chiara Barattieri di San Pietro (IUSS, Pavia)

A primer on Distributional Semantics and other Natural Language Processing techniques for clinical studies

Breakfast

Breakfast

Breakfast will be served at 'La Pecora Nera'

Hack those brains!

Hacking session - Group Work

Are you starting to getting tired? Don't give up!

Buon Appetito

Lunch Break

Lunch will be served at IMT canteen

Hack those brains!

Hacking session - Group Work

The last straight line!

COFFEEEEEE!

Coffee Break

Coffee Break will be served at 'La Pecora Nera'

Hack those brains!

Slides preparation - Group Work

Finish the figures and prepare a few slides

All

BrainHack Lucca Wrapup - All the BrainHackers

Presentation of the results of BrainHack Lucca projects

Some numbers from the past editions

Teaching hours

Hacking hours

Projects

Participants

Register

Registration is now closed.

Email us if you want to try to get a late registration.

Register

Registration is now closed.

Participants' checklist

In order to facilitate the participation to first day's training sessions, participants are recommended to follow these few preliminar steps:

Projects

Here you can find all the informations about the proposed projects.
If you want to submit a project you should first register, then follow the link to fill the form through a github issue.
Projects can be anything you'd like to work on during the event with other people (coding, discussing a procedure with coworkers, brainstorming about a new idea), as long as you're ready to minimally organize this!

Click here to watch a short video about "How to write a project for the BrainHack", in which we discuss how a project should be conceived and project leaders' duties.


Projects can be pre-registered and published on the website until 30/11/2025!

After this deadline, it will still be possible to propose a project during the 'project pitches' on day 1.

Click to submit a project filling a GitHub issue template!


An API to create, read, update, and delete BIDS dataset references in a database

By Vittorio Iacovella

Description


This project focuses on developing a lightweight yet functional API using FastAPI to manage references to BIDS datasets stored in a database. The API is designed to handle standard CRUD (Create, Read, Update, Delete) operations, allowing users to insert new dataset metadata, retrieve existing entries, update information, and remove records when needed. By implementing these features, the project aims to create a simple data catalog solution that can help researchers or teams keep track of datasets generated during an ongoing study or collaborative project. Although it is primarily an educational initiative, the project highlights the value of bringing modern web development practices into research environments, where such tools are still not widely adopted. Working on the API provides an opportunity not only to learn FastAPI and backend concepts, but also to approach datasets from a new perspective—coding often reveals new insights, questions, and structural patterns in the data itself. Ultimately, the project aspires to serve as both a learning journey for the author and a small-scale example of how REST APIs can contribute to better data organization in scientific workflows.

Goals for the BrainHack:

  • Test the CRUD capabilities of the API
  • Display results in a structured table populated with data fetched from the API
Contributors' skills:
  • Python
  • Basic Git skills (commit, push)


Frequency-Resolved Functional Connectivity for Sleep Stage Characterization and Automated Sleep Staging

By Arianna Armanetti, Miguel Ibañez Berganza & Ruggero Basanisi

Description


Human sleep consists of multiple stages (Wake, N1, N2, N3, REM), each characterized by distinct neurophysiological processes. Traditional sleep staging relies largely on power spectral features (delta, alpha, spindle/sigma, beta) extracted from individual EEG channels. However, sleep is also a highly network-driven process: slow waves exhibit large-scale synchrony, spindles reflect localized thalamo-cortical coupling, and REM sleep shows desynchronized, small-world-like interactions.Despite this, frequency-resolved functional connectivity [1], has been underused in sleep-stage research and rarely incorporated into automatic staging systems. Frequency-dependent covariance allows to capture signatures of collective behavior and of critical behavior, typical of dynamic phase transitions, across diverse frequency bands. Furthermore, the spectral analysis of frequency-dependent covariance may allow projecting brain activity onto a basis of spatiotemporal patterns, facilitating time-dependent dimensionality reduction. In brief, this quantity may reveal network-level signatures and traits of collective behavior - beyond the single-channel behavior -, invisible to traditional methods. This project aims to design an algorithm to efficiently evaluate frequency-resolved connectivity in EEG data, and to systematically evaluate its utility for sleep-stage characterization. Eventually, we would develop a prototype automatic sleep staging algorithm leveraging the network features unveiled by this quantity.

Goals for the BrainHack:

  • Design an algorithm to efficiently estimate the Frequency-Resolved Covariance matrix, and reproduce the fundamental results of reference [1].
  • Characterize connectivity patterns across sleep stages using frequency-dependent covariance and related measures. An interesting quantity in this context could be the PCA-based effective dimensionality of the global signal as a function of the frequency, in different sleep stages.
  • Identify robust network signatures that consistently differentiate stages within and across subjects.
  • Explore dynamic connectivity within-stage variability and transition dynamics.

[1] Rubén Calvo, Carles Martorell, Guillermo B. Morales, Serena Di Santo, and Miguel A. Muñoz, Frequency-Dependent Covariance Reveals Critical Spatiotemporal Patterns of Synchronized Activity in the Human Brain, Phys. Rev. Lett. 133, 208401 (2024).

Contributors' skills:
  • Minimal Python coding skills
  • Data manipulation


The Donnie Darko Project: Analysis of Human and Artificial Target-Tracking Trajectories

By Gianluca Maraschio, Francesco Biancalani, Jie Fu & Giorgio Stefano Gnecco

Description


The project analyzes human- and machine-generated trajectories in a target-tracking task. Part one evaluates how well human participants can distinguish real human trajectories (collected via the TickTacking interface) from human-like trajectories produced by an MPC algorithm (Masti et al., 2025). The goal is to assess the current effectiveness of the MPC model and identify whether further refinements are needed. A possible extension replaces the human classifier with an artificial one, using misclassification pressure—GAN-style—to optimize MPC hyperparameters. If time permits, part two explores extending TickTacking into a tool for visualizing and learning rhythmic patterns in music performance. By mapping the interface to piano keys and comparing a “target” (ideal) trajectory with repeated “follower” performances, we aim to test whether repeated practice drives convergence between the two, indicating a measurable learning effect relevant for reproducible musical execution.
Goals for the BrainHack:

  • Results of Data Analysis
  • Possible Developments of the TickTacking Interface
Contributors' skills:
  • Data Analysis
  • Statistics
  • Computer Programming


Bias Busters: Exposing Gender Bias in BERT's Latent Space

By Gaia Carlotta Fiamberti, Riccardo Vella, Tea Tucić, Francesco Pillitteri

Description


Large language models like BERT and GPT have revolutionized natural language processing but often encode social biases, particularly gender stereotypes. These biases associate certain professions or traits with specific genders, reflecting and sometimes amplifying societal prejudices. This project focuses on uncovering subtle gender biases embedded within the internal representations of these models, even without explicit prompts. Using innovative methods, we measure how likely models are to link professions with male or female pronouns through crafted test sentences. We then develop a mathematical technique to adjust the model’s internal word and sentence representations to neutralize these biases. Additionally, we investigate whether reducing occupational gender bias influences other biases, like those tied to family roles or personal traits, to understand the broader structure of gender bias in AI. This work aims to contribute toward a computational model of stereotypes that can be validated via social experiments.

Goals for the BrainHack:

  • Quantify gender bias in BERT's occupational embeddings using log-probability bias scores (a rigorous metric from Kurita et al., 2019)
  • Learn an optimal linear transformation that remaps BERT's latent space to reduce gender bias while preserving semantic information
  • Test generalization across multiple domains (occupations, family roles, personality traits, sentiment) to ensure the debiasing method is robust
Contributors' skills:
  • Python Coding
  • Statistics
  • NLP and Embeddings
  • Social Psychology
  • Critical Thinking
  • Good Vibes ✨


Associating Dynamic Functional Connectivity with Cognition: Source-based networks from EEG data

By Begum Ulku, Cecilia Moro

Description


We are developing a predictive model for individual working memory (WM) performance based on brain network activity derived from resting-state EEG data. Specifically, we are calculating functional connectivity (FC) matrices from source-localized EEG data and then using these matrices to train a machine learning model (such as Lasso Regression) to map from connectivity to behaviour. The project is for anyone interested in the neural correlates of cognition and investigating the connectivity for cognitive traits. The goal is to identify specific brain networks (groups of interconnected nodes) that are most predictive of working memory scores or any other cognitive domain that collaborators may be interested in investigating! However, the most involved network in the domain of working memory is the fronto-parietal, along with several ROIs such as DLPC, ACC, and anterior insula. Hence, we would form hypotheses based on the literature showing these networks and areas in relation to the task The data will be taken from an open-source data set: Max Planck Institut Leipzig Mind-Brain-Body Dataset - LEMON.

Goals for the BrainHack:

  • Feature Extraction:
    A) Derive the dynamic functional connectivity (dFC) matrix. B) Select different networks (groups of nodes, e.g. those that comprise the fronto-parietal network) and frequencies (e.g., theta) based on previous literature. C) Compute jump length and other indices of interest D) Transform the matrices into a readable format for the specific machine learning model
  • Train Models:
    Train a LASSO regression to predict subjects' cognitive battery scores (e.g. working memory) based on functional connectivity
  • (Optional) Obtain dFC from individual MRI and run the models with this more accurate feature This option requires segmentation of each subject's MRI into an atlas e.g. (Desikan–Killiany)
Contributors' skills:
  • Knowledge of neuropsychological testing for cognitive domains and Excel
  • Knowledge of interpreting dynamic functional connectivity from EEG
  • General knowledge of supervised and unsupervised machine learning models
  • Good understanding of general linear regressions (GLMs)
  • Brainstorm software basics (A MATLAB-based application)
  • Basic Python skills for machine learning


Decoding speech hierarchies in phantom-head 'Brain-less' EEG vs. real brain

By Francesca Collesei, Alessandra Federici, Giacomo Handjaras, Francesca Schiavone, Davide Bottari, Erica Iob

Description


Human brain is able to track hierarchical information embedded in naturalistic continuous speech. What about a phantom head with no brain but an artificial ear? The project aims to decode speech features information embedded in stories presented as audiobooks using activity recorded from an EEG phantom head equipped with a device converting sounds into electrical signals. The hierarchical speech features that we will try to decode include low-level acoustic features (e.g., envelope and spectrogram) and higher-level linguistic features (e.g., word frequency and lexical surprisal). We will assess how well this ‘brain-less’ EEG captures different information embedded in the speech signal by directly comparing it to real-brain EEG. What makes this project exciting is that we will try to test speech features decoding in a fully controlled, artificial system. To get started, one can begin by familiarizing themselves with EEG recording data and acoustic and linguistic features that can be extracted from continuous speech. Whether you are an expert or a complete beginner in decoding continuous, naturalistic information from EEG signals, it is a unique opportunity to learn and master cutting-edge neuroscience skills to work with ecological continuous stimuli. Plus, how many people can say they’ve worked with EEG activity from a phantom head?

Goals for the BrainHack:

  • Day 1) Check if we are equipped with correct matrices of speech features and EEG data to work on decoding scripts using mTRF toolbox in MATLAB. Develop the method to decode acoustic features (i.e., spectrogram and envelope) from EEG phantom head and compare it with real-brain EEG data
  • Day 2) Apply the developed method to decode other speech features (e.g., phoneme onset, word onset, lexical surprisal) and extract more complex linguistic information
  • Day 3) Compare accuracy of each model between phantom EEG sessions and real-brain EEGs, and summarize findings in a report or presentation


Contributors' skills:
  • Knowledge of acoustic features in continuous speech
  • Knowledge of semantic features in continuous speech
  • Linguistic knowledge
  • Decoding
  • Matlab
  • Python
  • Sharing ideas


Aperfit: Tearing apart brainwaves from background in electroencephalographic signals

By Guillaume Legendre

Description


Spectral parameterization is an EEG analysis technique that quantifies two major contributors to the signal: the aperiodic/ fractal component, which reflects the random-walk–like background activity of the EEG, and the oscillatory components, which correspond to synchronous periodic activity of neuronal populations. The aperiodic component raises growing interest because of its associations with neurochemical state, brain maturation, consciousness, and various pathological conditions. However, existing tools often struggle to accurately parameterize the aperiodic component in extreme physiological states (e.g., deep sleep) and typically require a priori parameter choices that can substantially affect results. To address these limitations, we propose developing a new Python package that models and quantifies the aperiodic component empirically from EEG signal properties. This work will clarify the nature of the aperiodic component, how it manifests in the EEG signal and what it reflects about underlying brain activity, an essential step toward improving our understanding of EEG dynamics. By providing an accessible tool to measure the aperiodic component from raw EEG data, this package aims to establish practical standards for the neuroscience community.

Goals for the BrainHack:

  • Review existing EEG literature on aperiodic component.
  • Review literature on modelization of random walk processes from other fields of science.
  • Find tools to derive model parameters directly from the EEG signal
  • Check the goodness of fit of this new parameterization technique over existing ones on EEG signals orf various datasets.
  • BONUS step: Combine this parameterization technique with Generalized Eigendecomposition on multichannels EEG recordings to remove the aperiodic component from EEG recordings.
Contributors' skills:
  • Python coding
  • EEG
  • Basic algebra


EEG/SoundScapes

By Matteo Lionello, Davide Coraci

Description


Soundscapes conceptualize acoustic environments in terms of how they are perceived, capturing higher‑order attributes such as affective quality and sound‑source composition beyond purely acoustic or psychometric measures. Although neuroscientific research increasingly adopts naturalistic paradigms, neurophysiological evidence linking soundscape attributes to brain activity remains scarce, largely due to the lack of EEG datasets recorded during real soundscape exposure. In this project, we aim to develop a proof‑of‑concept framework for inferring neurocorrelates of dynamic soundscapes by combining two complementary open datasets: (i) a corpus of annotated urban soundscape recordings, and (ii) an EEG dataset with continuous affective ratings (valence and arousal) of urban images. First, we will place the soundscape recordings in the circumplex affective space by extracting audio features and deriving perceptual descriptors from the literature and available annotations. In parallel, we will map the EEG‑derived affective ratings of urban images into the same affective space. By aligning audio-derived affective features with EEG affective responses obtained in a visual modality, we will test whether shared affective structure enables the construction of an encoding model that predicts EEG spectral properties from soundscape acoustic and source‑based features. This exploratory cross‑modal framework will allow us to assess whether affective descriptors of real sound environments can, in principle, be linked to neurophysiological markers, even in the absence of direct EEG‑during‑soundscape datasets.

Goals for the BrainHack:

Discuss strategies, develop a pipeline for the processing, discuss implementation, future direction, and impacts

Contributors' skills:
Any among:
  • EEG
  • Soundscapes
  • Deep learning
  • Audio & acoustics


Navigating the space of all possible face

By Miguel Ibáñez, Andrea Perna

Description


Scientific background: Facial attractiveness is influenced by biological, cultural and individual factors, and may relate to personality traits inferred from facial features. A recent method avoids explicit ratings and instead reconstructs each person’s aesthetic preferences by letting them navigate a low-dimensional face space. This makes it possible to explore questions such as: how much identity information is embedded in someone’s preferred faces? How do geometry and texture interact? How do gender, identity or personality traits shape preferences? Project description: The project develops a behavioural experimental framework to study facial aesthetics and perception. It relies on an evolutionary algorithm in which subjects repeatedly choose their preferred image between pairs, and successive generations of synthetic faces adapt to their aesthetic criteria, encoding memory of past choices. The goal is to extend this framework to include texture variation, enabling navigation of a richer face space. This requires integrating two existing codebases so that each individual in the genetic population carries both geometric and texture components. Objective: To build software that allows users to explore the space of human faces through binary choices, with full control over geometry and texture. Representing faces through principal components should keep this extended space efficient and manageable to navigate.

Goals for the BrainHack:

Expected outcome: The integrated software that we aim to develop during this hack will make possible running various psychophysical experiments on face recognition, facial attractiveness, and other topics.

Contributors' skills:
  • Python
  • Knowledge and understanding of PCA


Focus tracking interface with EEG device

By Maggie Bowen and Sojoud Jebril

Description


  • What are you doing, for whom, and why? Making a system to help students like us focus utilizing a commercial EEG. With our system we hope to demonstrate the possibilities of EEG-based focus apps.
  • What makes your project special and exciting? While there are other products like Muse which track focus they don’t have an interface that actually helps train focus and their system is quite costly. Ours will make use of an open source software and more cost effective device.
  • How to get started? First we’ll stream and build a classifier to understand when a user is in the alpha frequency band. Then, we’ll develop an interface to help guide them when they aren’t based on previous literature regarding meditative states and alpha.
  • Where to find key resources? NeuroPawn and OpenCortexBCI documentation


Goals for the BrainHack:

A fully functioning real-time interface for focus management and improvement.
Contributors' skills:
  • Interface design
  • Frontend/backend
  • Data Science


Team

The BrainHack Lucca organizing committee

Davide Coraci

Postdoctoral Fellow

Giacomo Handjaras

Assistant Professor

Gaia Carlotta Fiamberti

PhD Student

Linda Fiorini

PhD Student

Marco Fioretti

PhD Student

Matteo Lionello

PhD Student

Monica Betta

Assistant Professor

Riccardo Vella

PhD Student

Ruggero Basanisi

PostDoctoral Fellow

Tommaso Gili

Associate Professor

Valentina Elce

PostDoctoral Fellow

Questions, Services &
Useful Resources

Here you can find useful information about services in Lucca.

1. Do I need programming skills to participate?

The aim of BHL is to create an exchange environment accessible to all participants, allowing to propose projects in which different levels of programming skills are needed. Thus, participating to BHL can demand different levels of programming skills depending on the project that a participant decides to attend, from zero to hero.

2. Which kind of project can I propose as project leader?

All kind of projects are accepted, from zero programming skills projects (e.g.: brainstorming on a peculiar topic or discussing about common proceedings) to fully computational projects (e.g.: programming a toolbox to perform data analysis using a new methodological framework). The only limitation is that they should be brain-themed projects.

3. What do I need to participate BHL?

To participate BHL you just need your laptop and good vibes. The organization team will try to provide all participants with electrical supplies, if your laptop has a short charger cable we advise to bring with you an extension cord in order to reach plugs.

4. Where can I find an accomodation?

Lucca offers tons of possibilities in terms of accomodations with hotels and B&Bs. Accomodations inside the walled city are generally more expensive than accomodations outside or around the walls. In the near future we will try to stipulate an agreement with some structures for hosting participants at lower fares. We will keep you posted on this topic.

5. Where can I eat in Lucca?

BHL provides their participants with two coffee breaks per day, lunch and a buffet for the social event on the first night. However, if you want to discover the typical flavours of Tuscany, here we give you some suggestions for restaurants:

As an alternative, you can easily find around the city lots of spots to eat sandwiches, pizza and stuffed 'focaccia'.

6. What can I visit in Lucca?

You can enjoy Lucca just by hanging around the ancient walls or the streets of the walled city.
Moreover it offers some attractions:

Social networks

Here you can find our social media links

Contacts

Any question? Write us a message!
You can find more information about the school and how to reach us following THIS LINK.

Past editions

Visit the past editions of BrainHack Lucca