DeepFreak: Learning Crystallography Diffraction Patterns with Automated Machine Learning

Artur L. F. Souza, Leonardo B. Oliveira, Sabine Hollatz, Matthew Feldman, Kunle Olukotun, James M. Holton, Aina E. Cohen, Luigi NardiarXiv 2019

Introduction

In structural biology and materials science, determining the atomic structure of crystals is fundamental to drug discovery and semiconductor development. Serial crystallography utilizes high-powered X-ray sources to generate diffraction patterns from thousands of microcrystals. However, this process produces a massive volume of data, much of which contains no useful structural information.

The process of serial crystallography: incident radiation hits a crystal to produce a diffraction pattern.

The primary challenge lies in the manual screening of these images. Scientists must identify "hits"—images with clear diffraction spots—among hundreds of thousands of "blanks." This manual bottleneck hinders real-time experimental feedback and slows down discoveries at major facilities like SLAC. DeepFreak addresses this by automating the search for crystal structures using advanced machine learning.

Methods: DeepFreak and AutoML

To address the data bottleneck, the researchers developed DeepFreak, a convolutional neural network (CNN) based on the ResNet-50 architecture. Unlike standard ResNets optimized for 224x224 images, DeepFreak is modified to process 512x512 diffraction images. It employs intensified downsampling to preserve high-resolution features critical for identifying small, repetitive diffraction spots.

A key innovation in this work is the use of Automated Machine Learning (AutoML). Rather than relying on manual hyperparameter tuning, the team utilized Bayesian Optimization and Hyperband (BOHB) to search for optimal network topologies and training parameters. This approach ensured the model was finely tuned for the specific textures found in crystallography data, rather than general object recognition.

The DiffraNet Dataset

The study introduces DiffraNet, a first-of-its-kind dataset designed for benchmarking crystallography image classification. It consists of two main components:

  1. Synthetic Data: 25,000 grayscale images generated using the nanoBragg simulator, categorized into five classes: blank, no-crystal, weak, good, and strong diffraction.
  2. Real-World Data: 457 images from actual experiments, used to test the model's ability to generalize beyond simulations.
Examples of synthetic and real-world diffraction images from the DiffraNet dataset, showing various quality levels.

Key Insights and Results

The research highlighted that global texture is more important than local edge detection for identifying diffraction patterns. While traditional local feature extractors like SIFT struggled, global texture extractors (GLCM) combined with Random Forests performed remarkably well. However, the DeepFreak CNN ultimately provided the most robust performance:

  • Synthetic Accuracy: The custom CNN achieved 98.51% accuracy on the synthetic test set.
  • Real-World Generalization: Initially, models trained purely on synthetic data saw a performance drop when applied to real data. By using AutoML to bridge this "reality gap," the researchers achieved 94.51% accuracy on preprocessed real-world samples.
  • Binary Filtering: For the critical task of simply separating "hits" from "misses," the model reached an impressive 99.83% accuracy, demonstrating its readiness for real-time data reduction.

Conclusion and Future Directions

DeepFreak demonstrates that combining high-fidelity physics simulations with AutoML-tuned deep learning can effectively automate data reduction in crystallography. Future work aims to expand the dataset to include common experimental artifacts, such as ice rings, and to integrate the model into live data pipelines to provide instantaneous feedback to researchers during experiments.

Summary updated

BibTeX
@misc{souza2019deepfreak,
  author = {Artur L. F. Souza and Leonardo B. Oliveira and Sabine Hollatz and Matthew Feldman and Kunle Olukotun and James M. Holton and Aina E. Cohen and Luigi Nardi},
  title = {{DeepFreak: Learning Crystallography Diffraction Patterns with Automated Machine Learning}},
  year = {2019},
  eprint = {1904.11834},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1904.11834},
}
Figure