CLOSE ✕
Get in Touch
Thank you for your interest! Please fill out the form below if you would like to work together.

Thank you! Your submission has been received!

Oops! Something went wrong while submitting the form

Bad Seed

Bad Seed is an artificial intelligence based autonomous scheduler used at Brookhaven National Laboratory (BNL) in the National Synchrotron Lightsource II. As with the majority of technology used at BNL, there is no such thing as “optimized enough”. The only thing holding back science is time and resources, so, by working on this project, I hoped to mitigate some of those limitations.

Bad Seed Interface Prototype
The problem
Beamlines generate an enormous amount of data, much of which needs to be remeasured in order to create clear data. Originally, clearer data was gathered by remeasuring all samples 100 times.
The Goal
Get an algorithm to learn when to remeasure unclear samples (aka bad seeds) and reduce time dedicated to remeasuring samples.
The Solution
I used human psychology reward schedules in a custom Python TensorFlow environment to find bad seeds, using an Advantage Actor Critic agent.
Why it is Important
I was able to improve the amount of measurements by ten times. It means that the beamline scientist does not have to spend as much time glued to the beamline, looking at how clear the rings are on a sample, and can dedicate themselves to other work.
My Role
I was the front runner on this project, and was mentored extensively by Daniel Olds and Joshua Lynch. I created my own environment and lead the research in terms of determining the reward system, structuring the goals for the algorithm to acheive, and designing an associated interface. This research was taken and included in larger projects at the beamlines, such as “Gamifying the Beamline”.

Want to take a deeper dive into the research?

A deeper look at the problem...

At the beamlines, samples frequently need to be remeasured in order to make sure that we can get a clear  reading on them. But there is so much data generated in even one sample reading! How can we know which need to be remeasured?

Unclear Sample (notice the fuzzy rings)
Clear Sample

The original answer:
Just measure all of them 100 times!

Well.. that wastes a lot of time....

The Process...

Reward System Visualization

The goal is to get an agent (the computer’s decisions) to learn the rules of a particular environment. The environment will reward or penalize the agent for its decisions. For example, one of the requirements for our environment is that we do not want the agent to pick the same sample over and over again. It might look something like this:

In the actual coding environment, it looks more like this:

Picking and Agent:

Based on previous experimentation with cartpole and other basic reinforcement learning paradigms, the two agents that seemed most promising were the Advantage Actor Critic Algorithm (A2C) and the Double Deep Q-Learning (DDQN) algorithms. After testing on similar environments to the one described above, A2c seemed like the best choice because it learned faster:

Environment Goals:

  1. Getting the agent to choose the sample with the highest standard deviation
  2. Getting the agent to discover all of the bad seeds, not just one

The Solution...

Goal 1 achieved by rewarding choosing the sample with the highest deviation
Goal 2 achieved by penalizing for repeating a sample

Final Proof of Success:
My system took a total of 100 for all of the 10 samples, and it was able to pick out the same 3 bad seeds
The original system measured each of these 10 samples 100 times (total 1000 measurements), and it picked out these 3 bad seeds

Further Information:

This work is featured in this article:
https://iopscience.iop.org/article/10.1088/2632-2153/abc9fc/pdf

For a specialized report on the specific work done to complete the project, please read:
https://drive.google.com/file/d/1FUCtx72FnDm6gyakxc_htkzvooM9sN-m/view?usp=sharing

It can also be summarized by the following poster, which was presented on the SULI Symposium for the National Synchrotron Light Source II:
https://drive.google.com/file/d/1CsBQ0MGqiX8qP-ZjDgeAfuaB1RT17KMp/view?usp=sharing

The code dedicated to building this tool:
https://github.com/claracoo/bad_seed

The design structure for a possible front end interface:
https://www.figma.com/file/zcFOWq9VgoGqo0tZ4Gb0ns/SULI_Design?node-id=0%3A1

Recent Projects