Re: GammaMCA-TF version Redpitaya OS 2.07-51 initial testing

PRA, BeqMoni, Theremino, Fitzpeaks and beyond!
Post Reply
Conor Whyte
Posts: 126
Joined: 28 Apr 2019, 15:06
Contact:

Re: GammaMCA-TF version Redpitaya OS 2.07-51 initial testing

Post by Conor Whyte » 13 Apr 2026, 03:08

I wanted to see whether it would be possible to automatically flag specific gamma-ray spectral peaks after calibration using Python-based machine-learning tools. To do this, I built a system with TensorFlow and the Keras API in TensorFlow 2.21.0, which made it easier to develop neural-network models for recognizing peak shapes. I also used several other libraries to study peak shapes and energies and to account for how those features change with different detector types and FWHM values. For peak identification, I used reference material from the Canberra and IDB archives, along with nuclear data from the ENSDF database. Even though the new GammaMCA branch is still taking shape, the initial results look promising. In a few test runs with mixed isotopes, the system correctly identified the isotopes in the spectra. It can also estimate the local background on both sides of a peak, subtract that background, find the half-height of the corrected peak, interpolate the crossing points, and then calculate FWHM, percent resolution, and relative efficiency.
I used GammaMCA as a platform here to try this out on the RedPitaya as the GammaMCA being a webapp was not too difficult to adapt to the Redpitaya's app environment.

I included some pictures of what the app looks like with tensorflow.
Attachments
Screenshot 2026-04-12 000451.jpg
Screenshot 2026-04-12 000451.jpg (44.36 KiB) Viewed 337 times
Screenshot 2026-04-12 000422.jpg
Screenshot 2026-04-12 000422.jpg (36.97 KiB) Viewed 337 times

User avatar
Sesselmann
Posts: 1374
Joined: 27 Apr 2015, 11:40
Location: Sydney
Contact:

Re: GammaMCA-TF version Redpitaya OS 2.07-51 initial testing

Post by Sesselmann » 13 Apr 2026, 08:24

Very interesting,

It would be even more interesting to develop an AI that could recognise an uncalibrated spectrum based on its overall shape.

Steven

Conor Whyte
Posts: 126
Joined: 28 Apr 2019, 15:06
Contact:

Re: GammaMCA-TF version Redpitaya OS 2.07-51 initial testing

Post by Conor Whyte » 13 Apr 2026, 10:04

Sesselmann wrote:
13 Apr 2026, 08:24
Very interesting,

It would be even more interesting to develop an AI that could recognise an uncalibrated spectrum based on its overall shape.

Steven
This is exactly the direction the experiment is heading. So far, it has been limited to FWHM calculations and individual peak analysis, but with additional resources, that will be the focus of the next iteration.

User avatar
Sesselmann
Posts: 1374
Joined: 27 Apr 2015, 11:40
Location: Sydney
Contact:

Re: GammaMCA-TF version Redpitaya OS 2.07-51 initial testing

Post by Sesselmann » 13 Apr 2026, 10:11

This was my intention when I wrote the original version of Impulse, it had a spectrum database for users to publish their calibrated spectra. The idea was to build a large database of calibrated spectra that could later be used to train an AI on, but the optake and number of users willing to publish their spectra were so low - I abandoned the idea.

Database is still there... https://www.gammaspectacular.com/spectra/

Conor Whyte
Posts: 126
Joined: 28 Apr 2019, 15:06
Contact:

Re: GammaMCA-TF version Redpitaya OS 2.07-51 initial testing

Post by Conor Whyte » 13 Apr 2026, 12:43

That makes sense. I have been thinking along similar lines, but with a more automated workflow.

One possibility would be to have the spectroscopy program automatically contribute spectra to a central cloud database whenever the user runs it, ideally as an opt-in feature. Over time that could build a large library of calibrated spectra and spectrum shapes that could then be used to train a TensorFlow model for pattern recognition and isotope identification.
It seems like the key issue from your earlier attempt was not the idea itself, but the low number of users willing to manually publish their spectra. If contribution were made simple and mostly automatic, the database might grow enough to become useful for AI training.
I think the other important part would be "standardizing" the uploaded data so the spectra are calibrated and tagged consistently. Without that, even a large dataset would be very hard to train on.
So the concept still seems promising to me, especially if the contribution process is low-friction and the users get some direct benefit from participating.

User avatar
Sesselmann
Posts: 1374
Joined: 27 Apr 2015, 11:40
Location: Sydney
Contact:

Re: GammaMCA-TF version Redpitaya OS 2.07-51 initial testing

Post by Sesselmann » 14 Apr 2026, 13:09

Impulse had a simple "Publish" button - when the user clicked publish there was a message modal that asked the user to confirm that this was indeed a calibrated spectrum worth publishing. The spectrum was then converted to a standard number of channels and saved in a standard format.

From within Impulse users could preview the thumbnail spectra and optionally download the full spectrum.

The initial uptake was low, but the reason could have been that Impulse V 1.0 was written in Python with Dash Plotly (browser GUI) - it was slow and un-responsive.

I then did a complete refactor with a new GUI and released it as ImpulseQt - in this version I dropped the database. ImpulseQt has had 166 installs from the MS Apps store and many more more directly from GitHub. Works for Mac users as well.

https://www.gammaspectacular.com/blue/s ... /impulseqt

The database as I said still exists and the upload function could be included in future versions.

Conor Whyte
Posts: 126
Joined: 28 Apr 2019, 15:06
Contact:

Re: GammaMCA-TF version Redpitaya OS 2.07-51 initial testing

Post by Conor Whyte » 16 Apr 2026, 09:35

Sesselmann wrote:
14 Apr 2026, 13:09
Impulse had a simple "Publish" button - when the user clicked publish there was a message modal that asked the user to confirm that this was indeed a calibrated spectrum worth publishing. The spectrum was then converted to a standard number of channels and saved in a standard format.

From within Impulse users could preview the thumbnail spectra and optionally download the full spectrum.

The initial uptake was low, but the reason could have been that Impulse V 1.0 was written in Python with Dash Plotly (browser GUI) - it was slow and un-responsive.

I then did a complete refactor with a new GUI and released it as ImpulseQt - in this version I dropped the database. ImpulseQt has had 166 installs from the MS Apps store and many more more directly from GitHub. Works for Mac users as well.

https://www.gammaspectacular.com/blue/s ... /impulseqt

The database as I said still exists and the upload function could be included in future versions.
Thank you for the background and for explaining how Impulse and ImpulseQt evolved. It is a shame the database feature did not gain more traction at the time, although it makes sense that performance limitations in the original version may have affected adoption.

I still think the idea of a database of shape files for AI training has real value. With the improvements you have already made in ImpulseQt, and perhaps with some refinement to the upload and publishing workflow ( in the future), I wonder whether this could be revisited in a future release. It seems like there could be strong potential there, especially if the process is made fast and straightforward for users or even "automatic".

Post Reply

Who is online

Users browsing this forum: No registered users and 7 guests