Inspiration

My brother is an odd guy, you never know what he's up to. One day hes finding gold in the mountains, then hes a certified emt and firefighter in training. He called me complaining about how expensive NMR's were (while alternatives exist like benchtop NMR, they don't have high utility).

This set the stage for our work: a chance to both challenge the status quo in NMR spectroscopy and, perhaps, find a creative (free) and very nerdy birthday gift alternative.

What it does

In simple terms we aim to "fill in the gaps" of zero-to-ultralow-field NMR (ZULF) by learning the relationship of atom spin, position, heteronuclear/j-coupling, and chemical shifts with regards to the amplitude of high field NMR spectroscopy.

This enables the general public—including my brother—to do effective and meaningful NMR spectroscopy even at home. This transformation empowers anyone—from pharmacologists or researchers to enthusiastic amateurs (like my brother)—to perform higher quality NMR spectroscopy without friction free, multi-million-dollar magnets and dedicated lab. Moreover, thanks to the extremely low magnetic field strengths involved, our approach could eventually be embedded in everyday devices (for example phones), opening new avenues in pharmacology, chemistry, public safety (e.g., sobriety tests), and nutrition awareness.

How we built it

We built a hybrid deep learning model that combines a Convolutional Neural Network (CNN) and a Bidirectional Long Short-Term Memory (LSTM) network. The CNN captures spatial patterns in the frequency domain, applying 1D convolutions and normalization techniques, while the LSTM models the sequential dependencies in the time-domain NMR signals. These two components work together to learn complex temporal and spectral relationships in the data. We used synthetic NMR data generated by simulating peaks with random chemical shifts, coupling constants, and intensities, followed by Fourier transforms and T2 decay to model real-world behavior. A weighted Mean Squared Error (MSE) loss function helps prioritize important features in the signal, and we use mixed-precision training for efficiency. After training, the model is evaluated by comparing the reconstructed NMR spectra to true signals, demonstrating its effectiveness in bridging ZULF and high-field NMR.

Challenges we ran into

It was extremely difficult to find ZULF data, even when talking to professionals in the field. Given it was a Saturday we had to harass people out of working hours and pray. Risking a restraining order, we managed to contact UNC's resident NMR specialist, Dr. Ter Horst who referred us to the NMR specialist at NCSU, Dr. Thomas Theis. He had worked with ZULF a lot and referenced very useful equations for things such as the Hamilton constant (this was deprecated in the new approach). With a more thorough understanding of NMR spectroscopy, we were able to develop synthetic data that replicated real world Ethanol. This means that any liquid-state, micro tesla ZULF NMR at the same Larmor frequency can be converted and provide much more useful information.

the input dimensions across the project were also a major hassle, but thankfully we're stubborn (it took many hours...)

In addition, rather than developing the front-end with traditional web technologies like HTML, CSS, and JavaScript, we decided to challenge ourselves by using the Streamlit Python library. Learning a new framework in just 24 hours was no easy feat, and integrating our model into the web interface presented additional challenges. However, despite the steep learning curve, we came to appreciate Streamlit’s simplicity, built-in features, and overall convenience, which definitely made our development process more enjoyable.

Accomplishments that we're proud of

We’re excited to have made strides toward democratizing science. By making NMR spectroscopy more accessible, we’ve opened doors for students, small colleges, and independent researchers. Dr. Theis himself noted that our work could help individuals better monitor their health and dietary intake, potentially revolutionizing how we approach personal wellness and public health. It could also prevent recreational drugs, such as weed, from being laced with dangerous chemicals like fentanyl.

What we learned

We learned a lot about front-end web development thanks to Streamlit as it enabled us to quickly make a pretty, functional website with full customization! Unfortunately, we also were forced to learn a lot about sciency stuff. It has its own unique charm, but was mostly painful.

What's next for NMR Spectroscopy: Nuclear Resonance Sequence Conversion

We're excited to say our research will continue with the guidance of Dr. Theis. Together, we'll refine our Nuclear Resonance Sequence Conversion techniques to make NMR spectroscopy more precise, affordable, and accessible. This collaboration is especially promising for pharmacology and healthcare—improved NMR methods can enhance drug research and development (by reducing the need for crystallization and x-ray refraction of complex compounds like sponge antibiotics), provide useful legal evidence, and support personal health.

Built With

Share this project:

Updates