원시데이터 수집 시스템
선정목록으로

Learning to automate cryo-electron microscopy data collection with <i>Ptolemy</i>

관련 필름·전자재료 · (16) CPI(투명 폴리이미드)

기본 정보

저자
  1. Paul T. Kim — Simons Machine Learning Center, Simons Electron Microscopy Center, New York Structural Biology Center, New York, NY USA
  2. Alex J. Noble — Simons Machine Learning Center, Simons Electron Microscopy Center, New York Structural Biology Center, New York, NY USA
  3. Anchi Cheng — Simons Electron Microscopy Center, New York Structural Biology Center, New York, NY USA
  4. Tristan Bepler — Simons Machine Learning Center, Simons Electron Microscopy Center, New York Structural Biology Center, New York, NY USA
DOI
10.1107/s2052252522010612
저널
IUCrJ
발행년도
2022
발행기관
International Union of Crystallography
피인용수
15
라이선스
cc-by
논문 유형
–
언어
–
원문 페이지
https://doi.org/10.1107/s2052252522010612
토픽
Electron and X-Ray Spectroscopy Techniques
OpenAlex ID
W4312058800

평가 내용

관련도
관련
사업분야
필름·전자재료 · (16) CPI(투명 폴리이미드)
부 분야
–
R&D 측면
–
확신도
–
근거 용어
–
판단 근거
임베딩 유사도 기반 평가로 '필름·전자재료 > CPI(투명 폴리이미드)' 분야에 선정된 논문입니다.
R&D 활용 포인트
–
평가 입력
–

초록

Over the past decade, cryo-electron microscopy (cryoEM) has emerged as an important method for determining near-native, near-atomic resolution 3D structures of biological macromolecules. To meet the increasing demand for cryoEM, automated methods that improve throughput and efficiency of microscope operation are needed. Currently, the targeting algorithms provided by most data-collection software require time-consuming manual tuning of parameters for each grid, and, in some cases, operators must select targets completely manually. However, the development of fully automated targeting algorithms is non-trivial, because images often have low signal-to-noise ratios and optimal targeting strategies depend on a range of experimental parameters and macromolecule behaviors that vary between projects and collection sessions. To address this, Ptolemy provides a pipeline to automate low- and medium-magnification targeting using a suite of purpose-built computer vision and machine-learning algorithms, including mixture models, convolutional neural networks and U-Nets. Learned models in this pipeline are trained on a large set of images from real-world cryoEM data-collection sessions, labeled with locations selected by human operators. These models accurately detect and classify regions of interest in low- and medium-magnification images, and generalize to unseen sessions, as well as to images collected on different microscopes at another facility. This open-source, modular pipeline can be integrated with existing microscope control software to enable automation of cryoEM data collection and can serve as a foundation for future cryoEM automation software.

본문 60,283자

본문 펼치기
### research papers ## IUCrJ ISSN 2052-2525 CRYOjEM Received 17 June 2022 Accepted 3 November 2022 Edited by L. A. Passmore, MRC Laboratory of Molecular Biology, United Kingdom Keywords: cryoEM; automated cryoEM data collection; computer vision; microscope automation software; machine learning; deep learning; automation; single-particle cryoEM. Supporting information: this article has supporting information at www.iucrj.org ### Learning to automate cryo-electron microscopy data collection with Ptolemy Paul T. Kim, <sup>a</sup> Alex J. Noble, <sup>a</sup> Anchi Cheng <sup>b</sup> and Tristan Bepler <sup>a</sup> aSimons Machine Learning Center, Simons Electron Microscopy Center, New York Structural Biology Center, New York, NY USA, and <sup>b</sup> Simons Electron Microscopy Center, New York Structural Biology Center, New York, NY USA. *Correspondence e-mail: tbepler@nysbc.org Over the past decade, cryo-electron microscopy (cryoEM) has emerged as an important method for determining near-native, near-atomic resolution 3D structures of biological macromolecules. To meet the increasing demand for cryoEM, automated methods that improve throughput and efficiency of microscope operation are needed. Currently, the targeting algorithms provided by most data-collection software require time-consuming manual tuning of parameters for each grid, and, in some cases, operators must select targets completely manually. However, the development of fully automated targeting algorithms is non-trivial, because images often have low signal-to-noise ratios and optimal targeting strategies depend on a range of experimental parameters and macromolecule behaviors that vary between projects and collection sessions. To address this, Ptolemy provides a pipeline to automate low- and medium-magnification targeting using a suite of purpose-built computer vision and machine-learning algorithms, including mixture models, convolutional neural networks and U-Nets. Learned models in this pipeline are trained on a large set of images from real-world cryoEM data-collection sessions, labeled with locations selected by human operators. These models accurately detect and classify regions of interest in low- and medium-magnification images, and generalize to unseen sessions, as well as to images collected on different microscopes at another facility. This open-source, modular pipeline can be integrated with existing microscope control software to enable automation of cryoEM data collection and can serve as a foundation for future cryoEM automation software. 1. Introduction Cryo-electron microscopy (cryoEM) is a rapidly growing method for determining the structure of proteins in nearnative conformations at high resolution (Bai et al., 2015). CryoEM structure determination typically starts with the application of a solution containing purified protein to an EM grid, a holey substrate supported by a thin metal mesh (Cheng et al., 2015). The sample droplet is then reduced to a thin liquid film and the grid is plunged into a cryogen, converting the thin film to a layer of vitrified ice (Egelman, 2016). The grid is then transferred to a transmission electron microscope (TEM) to collect high-magnification (high-mag) micrographs of the particles suspended in vitreous ice within the holes. Vitreous ice containing particles is found in windows in the grid termed ‘squares’ [Fig. 1(a)]. Within these squares are circular ‘holes’ [Fig. 1(b)] and particle images are obtained by taking highresolution micrographs of the ice within these holes [Fig. 1(c)]. Each micrograph will typically provide numerous individual 2D projections of the protein particles, and these images can be processed to produce a three-dimensional map of the protein of interest (Wu & Lander, 2020). Solving a protein Published under a CC BY 4.0 licence structure to high resolution usually requires tens to many ### research papers Figure 1 Example square, hole and highest-magnification exposure. Windows in the cryoEM grid containing ice are known as ‘squares’. Within squares are circular ‘holes’. Highest-magnification exposures are taken within holes. Ideal highest-magnification exposures contain particles (as shown) and have thin ice. hundreds of thousands of individual randomly oriented particle projection images which often requires collecting many thousands of high-quality high-resolution micrographs. Because EM grid preparation is not a well controlled process, the locations where highest-magnification data are to be collected must be identified from a series of successively increasing magnification images (Chua et al., 2022). The process of collecting high-magnification data begins by taking low-magnification images of the grid [Fig. 2(a)], typically acquired at a pixel size of �200–500 nm pixel <sup>�1</sup> . Squares are selected from these images, and medium-magnification images [Fig. 2(b)] with a pixel size of �10–100 nm pixel <sup>�1</sup> are taken within these squares. Holes and subsequent high Figure 2 Example low- and medium-magnification images: carbon grid (left) and gold grid (right). First, low-magnification images of the grid, where squares are visible, are acquired at a pixel size of �200–500 nm pixel <sup>�1</sup> . Subsequently, medium-magnification images are acquired at a pixel size of �10–100 nm pixel <sup>�1</sup> by imaging the regions inside the squares. magnification collection locations are identified from the medium-magnification images. Not all squares or holes will be suitable for collection; the goal is to identify squares and holes in the grid with vitreous ice of suitable quality, ice that is the right thickness (typically slightly thicker than the largest diameter of the particle) and that contains a reasonable number of particles, ideally oriented in a range of angles (Noble et al., 2018). Ultimately, the success of a data collection is determined by the quality of the resulting 3D reconstruction, which is a function of the number of particles found, the range of orientation angles present among the 2D projections, and the maximum resolution and signal-to-noise ratio (SNR) of the micrographs. Automated data-collection software such as Leginon (Carragher et al., 2000; Suloway et al., 2005), SerialEM (Mastronarde, 2005) or EPU (made by ThermoFisher Scientific) provide several built-in tools for identifying potentially promising squares and holes. These tools include template-, correlation- or feature clustering-based image analysis algorithms and automated selection capabilities. However, none of these tools generalize out-of-the-box across the wide variety of grids that are encountered in practice. They can struggle to both detect holes and squares under contaminated or lowSNR conditions and to reliably prioritize good collection locations across different macromolecule specimens. This means that microscope operators must often manually identify squares in low-magnification images and tune parameters used for automated targeting of holes in medium-magnification images (https://em-learning.com). Additionally, existing hole targeting algorithms fail on a non-trivial percentage of cases, especially on noisy, contaminated or carbon grids with minimal contrast variation between the holes and substrate. Operators are then required to manually target holes in medium-magnification images which is a labor-intensive task. The human operator time required for targeting limits the efficiency of collection on expensive and over-subscribed cryotransmission electron microscopes (cryo-TEMs). Additionally, with increasing detector speeds, automated targeting would ### research papers allow for better utilization of microscope time that is otherwise wasted waiting for human input. Thus, fully automated targeting methods are needed to not only reduce the burden on human operators, but also to increase access and throughput for the entire scientific research community. However, human-free automation of cryoEM data collection is challenging. Many types of EM grids exist, each with holes and squares of different shapes, sizes and spacings. The grids themselves are made from different materials (e.g. carbon or gold), which causes the resulting low- and mediummagnification images to have very different properties (Fig. S1 of the supporting information). Carbon grids, for example, have significantly less contrast between collection regions of interest (ROIs) in holes and background substrate at medium magnification compared with gold grids (Fig. S1). This is further complicated by variable sample preparation conditions leading to variable ice thickness and empty regions of the grid, along with deformations, contamination and lesions, all of which introduce visual artifacts (Fig. S1). In addition, cryoEM images have low SNR, especially at high magnification, and microscope parameters such as electron beam dose (often between 40 and 80 e <sup>�</sup> A <sup>˚</sup> <sup>�2</sup> ) can significantly alter image properties (Cheng et al., 2015). Furthermore, images at each magnification level may contain many collection ROIs or none at all (Lyumkis, 2019). Finally, even if good candidate collection ROIs are found, it is challenging to find ice containing many particles with enough diversity of projection orientations to produce high-quality 3D reconstructions. In recent years, machine-learning techniques have transformed single-particle cryoEM data analysis. Tools such as MicAssess (Li et al., 2020) and MicrographCleaner (SanchezGarcia et al., 2020) allow for efficient post-processing of highresolution micrographs collected, whereas others such as Topaz (Bepler et al., 2019), CASSPER (George et al., 2021), Warp (Tegunov & Cramer, 2019) and crYOLO (Wagner et al., 2019) use deep learning to automate particle picking and image denoising. Machine-learning-based 3D reconstruction algorithms have also emerged, including cryoSPARC (Punjani et al., 2017) and CryoDRGN (Zhong et al., 2021). These methods have significantly improved our ability to analyze high-resolution cryoEM data quickly and thoroughly after collection. However, comparatively little attention has been given to accelerating or automating data collection itself. Yokoyama et al. (2020) recently introduced a machinelearning method for detection and classification of ROIs in medium-magnification images, but it requires retraining a model with an annotated medium-magnification image dataset for each data-collection session. To address these challenges in cryoEM data collection, we present Ptolemy, a pipeline that uses computer vision algorithms and pre-trained convolutional neural networks (CNNs) to navigate cryoEM grids at low and medium magnification and determine high-quality targeting locations without human input. We train the Ptolemy models on large datasets of lowand medium-magnification images with corresponding collection locations selected by operators from 55 different data-collection sessions. These sessions include carbon and Figure 3 Pipeline overview. High-magnification images are taken from holes in medium-magnification images, which come from squares in lowmagnification images. (a) Ptolemy detects, crops and then classifies squares in low-magnification images, which have a pixel size of approximately 200–500 nm pixel <sup>�1</sup> . (b) Next, Ptolemy detects, crops and then classifies holes in subsequent medium-magnification images, which have a pixel size of approximately 10–100 nm pixel <sup>�1</sup> . gold holey grids and feature a variety of proteins, grid conditions, magnifications and electron beam dosages. Rather than attempting to learn separate models for different grid types or for different particles, we develop a single unified pipeline to localize and classify ROIs to approximate user selection locations in low- and medium-magnification cryoEM images (Fig. 3). We demonstrate that Ptolemy can effectively detect and classify squares and holes in low- and medium-magnification images. We evaluate these predictions with comparison against operator-selected locations, while noting that operators target incompletely. We validate the models by holdingout entire data-collection sessions to confirm that the models generalize well to unseen sessions. Additionally, we compare our medium-magnification localization algorithm to an existing method (Yokoyama et al., 2020) that performs medium-magnification localization (in that study, this is referred to as low-magnification localization) and show that our method yields superior generalization performance. Finally, a separate companion paper has been published: ‘Fully automated multi-grid CryoEM screening using Smart Leginon’, where the utility of Ptolemy in real-world collection cases is demonstrated and analyzed (Cheng et al., 2022). The Ptolemy source code is freely available for academic use at (https://github.com/SMLC-NYSBC/ptolemy) under CC BY-NC 4.0 license. Ptolemy is designed to be modular and to integrate directly with existing microscope control software. More information on Ptolemy can be found in Appendix A. 2. Methods To automate microscope targeting for single-particle cryoEM data collection, we divide the problem into four sub-problems: (1) low-magnification square localization, (2) low-magnifica tion square classification, (3) medium-magnification hole localization and (4) medium-magnification hole classification. For low- and medium-magnification localization, the goal is to identify all possible collection ROIs: squares in low magnification and holes in medium magnification. The cropped ROIs are then fed into separate classification models at each level that determine whether these ROIs should be collected. Low-magnification localization is solved by pixelwise image segmentation using a mixture model, whereas medium-magnification localization is solved using a U-Net with a novel lattice-fitting algorithm (Gupta & Sortrakul, 1998; Ronneberger et al., 2015). Classification at low magnification is achieved using a feedforward CNN whereas medium-magnification classification uses the U-Net localization probabilities because they outperformed a separate downstream classifier in our experiments. Training and hyperparameter information for all trained models can be found in Appendix B. 2.1. Datasets and splits The data used to train and validate all models and algorithms come from 55 cryoEM data-collection sessions performed at the Simons Electron Microscopy Center (SEMC), a center within the New York Structural Biology Center (NYSBC), from 2018 to 2021. The sessions include gold and carbon grids, featuring regularly spaced and lacey holes, with tilted and untilted collection. Lacey-hole grids and tilted collection images were only used for low-magnification (square) localization and classification. Positive labels represent targeted selection locations used in these sessions. All labeled squares are manual operator selections on the lowmagnification images. On the other hand, labeled holes on the medium-magnification images are generally automated selections optimized by operators using template-correlation-based hole localization and ice-thickness-based hole classification. A minority of labeled holes were also manually selected by operators. Data-collection sessions generally involve different samples, preparation methods and microscope settings (Weissenberger et al., 2021). This results in considerable variation between sessions in the appearance of collection locations especially at medium magnification, as well as in the characteristics that make for good collection locations (Fig. S1). Therefore, to ensure that our models can generalize to ### research papers unseen data-collection sessions with different experimental parameters, we primarily use session splits, where a set of sessions (termed ‘held-out sessions’) are withheld from the dataset used to train the models (training set). All performance metrics are reported from results on these held-out sessions. 2.2. Square localization The goal of square localization is to locate all squares (windows in the grid that may contain imageable ice) in lowmagnification grid images. The input is a low-magnification image, and the output is a set of rectangular boxes tightly bounding the squares (Fig. 4). We find these boxes using a mixture model-based image segmentation algorithm followed by a geometric algorithm for identifying the aligned minimum bounding rectangles surrounding each square. Pixels in the image are first separated into two classes based on pixel intensity using a Poisson mixture model [Fig. 4(b)] (Forbes, 2018). Mixture model separation works because the distribution of pixels in the image can be accurately decomposed into low-intensity pixels coming from the thick grid bars in the surrounding background and higher-intensity pixels coming from the much thinner squares (Fig. S2). This approach avoids the need for a user to set a specific intensity threshold for identifying squares, which changes from session to session. Next, we apply a flood filling algorithm to identify discrete regions from the segmented square pixels and then find a minimum bounding convex polygon to bound the pixels in each square [Fig. 4(c)]. Finally, we take advantage of the fact that the squares are axis-aligned to find the angle �, for each low-magnification image where the minimum bounding rectangles aligned with - bounding each minimum bounding convex polygon have the smallest total area. Formally, we seek PN argmin� i <sup>A</sup> i; � <sup>for N polygons, where Ai,</sup> <sup>�</sup> <sup>is the area of the</sup> argmin� i <sup>A</sup> i; � <sup>for N polygons, where Ai,</sup> <sup>�</sup> <sup>is the area of the</sup> minimum bounding rectangle around the ith polygon, aligned at angle �. We find this angle - using bounded optimization (Brent, 1973), and the resulting minimum bounding rectangles are used to obtain aligned crops of the squares in the lowmagnification image [Fig. 4(d)]. This algorithm is applied to 1304 low-magnification images, resulting in 41 000 crops of squares. PN Figure 4 Example of the square localization procedure. (a) Original input image. (b) Mask recovered after segmenting pixels. (c) Finding convex polygons around the separate regions in the mask. (d) Aligned minimum bounding rectangles around the polygons, used for crops of the images. ### research papers 2.3. Hole localization The goal of hole localization is to detect all hole locations in medium-magnification images. However, unlike in square localization, a mixture model-based segmentation approach does not work, because the difference in pixel intensities between the holes and the surrounding background is negligible, particularly for carbon grids. Some medium-magnification images even have ‘inverted’ holes where the pixel intensity within the hole is lower than the surrounding region (Fig. 5). Here, our choice of model is informed by the available data. Although we do not have a dataset of bounding boxes around holes, we do have a large dataset of 28k carbon and gold holey grid medium-magnification images with locations at or near the center of holes where operators collected high-magnification micrographs. Therefore, we seek to learn the hole centers in each pixel-normalized medium-magnification input image by training a U-Net model to output a map with the same dimensions as the input containing 1 at the locations where the operator collected and 0 everywhere else (Figs. 5 and 6). We choose a U-Net architecture, because the neurons in the bottleneck layer have large receptive fields, allowing them to capture needed context, while the output layers use the information propagated from the bottleneck, as well as where O is the output of the U-Net, N is the number of pixels in the image, La, b is the lattice generated by anchor points a and b, and �1 and �2 allow us to independently weight the cost for false positives and false negatives. Candidate anchor point pairs are found by taking centroids of high-probability regions in the U-Net output map, and for each centroid, pairing with high-resolution features, to find the hole centers. The pixels in the medium-magnification image are normalized to control for variance in electron dose. Additionally, holes are known to lie on a regular square lattice, so we post-process the output of the U-Net to find the best fitting lattice. Given the lattice points in the image, we then crop around those points to extract hole images (Fig. 7). This helps to extend the predicted map from the U-Net to capture all holes in the image, not just the holes that the operators picked, while simultaneously cleaning erroneously detected regions. We find the lattice from the U-Net output map by searching pairs of candidate anchor points and selecting the pair for which the lattice produced by these anchor points has the smallest pixelwise error against the output map. We find argmina; b XN i �1ðoi � liÞð1 � liÞ þ �2ðli � oiÞðliÞ; oi 2 O; li 2 La; b; Figure 5 Example medium-magnification images. Human operator-selected locations are marked in yellow. The input to the U-Net is the image without any marking for the selection locations, and the output is a map with a 1 at each pixel where a selection was made and 0 elsewhere. In rare cases (right), holes can be darker than the surrounding region. Figure 6 Example hole-center detection without lattice fitting. For some cases, taking the centroids of the high-probability regions predicted by the U-Net is sufficient. (a) Input image. (b) U-Net output. (c) Centroids from high-probability regions in U-Net output (red). ### research papers Figure 7 Example hole-center detection on a difficult image. On this low-contrast image, lattice fitting extends to missed holes while removing erroneous detections. (a) Input image. (b) U-Net output. (c) Centroids from high-probability regions in U-Net output (red). Many locations outside holes are detected incorrectly, and one hole (orange) is missed. (d) Running the optimal-lattice-finding algorithm results in finding lattice anchor points (cyan). (e) The lattice generated by these anchor points (cyan) results in coverage of all holes and cleans the incorrect detections. the K closest to other centroids. K trades performance for run time. Here we use K = 6. Imposition of a regular square lattice over the U-Net output causes Ptolemy to be unable to handle tilted data collection because the tilt causes the hole centers to lie on a parallelogram-shaped (oblique) lattice rather than a regular square lattice. Support for tilted data collection will be added to a near-future update of Ptolemy. To improve training, we apply Gaussian blur to the model output before computing the loss (Shorten & Khoshgoftaar, 2019). This helps, because the exact location the operator selects in a hole is noisy: the selection location that is near the center of the hole but there is often deviation from the exact center pixel, and the direction and magnitude of displacement from the center varies between medium-magnification images. Therefore, this smoothing allows the model to learn the centers of these holes, rather than having to learn the displacement from the center for every hole image. We also perform gradient descent on the sigma parameter of the Gaussian blur simultaneously with training the U-Net weights to allow the model to learn the optimal level of smoothing over training time (Fig. S3). To improve generalization, we apply both random 90 <sup>�</sup> rotation augmentation to the images during training as well as random inversion of the normalized pixels. Inversion of pixels is helpful, because for some sessions, particularly with carbon grids, the pixels in the holes are darker than the background pixels. Although pixel inversion augmentation allows for better carbon grid hole targeting, it does not affect gold grid images which do not suffer from contrast inversions. 2.4. Square and hole classification models In square and hole classification, we aim to obtain rankings of squares and holes in images to prioritize the ordering with which they are targeted. Although there are many possible parameters that may be important for determining whether a square or hole contains high-quality particles, experienced operators are able to consistently find good locations, suggesting that at least some features of good target locations are identifiable in low- and medium-magnification images. Therefore, for each magnification we train a separate CNN to classify squares or holes as collected or not collected by operators. The input to our model is a cropped image of a square or hole, extracted using the square-localization method or hole-localization method above, and the output is a scalar probability. 2.4.1. Square classification. We train our square classification model on a dataset containing 41k square crops, of which 11k were squares collected. Square images are normalized based on the intensity of all pixels within the bounding boxes for the squares in each low-magnification image to control for electron dose. We also include random forest (RF) and logistic regression (LR) models trained on summary statistics of the pixels extracted from the square image crops. This is because the operators typically use characteristics like the size/area and brightness of the squares to make their selections. Therefore, we include baselines which reflect this knowledge. The summary statistics used as features are mean intensity, maximum intensity, minimum intensity, variance in intensity, kurtosis, skew and crop area. ### research papers 2.4.2. Hole classification. We compare the summed pixelwise probabilities output by our localization U-net within each hole against two CNNs trained on a dataset containing 571k hole crops, of which 410k were targeted by operators. The dimensions of the holes and, therefore, the dimensions of the resulting crops vary widely between data-collection sessions. However, we do not want the model to use the size of the input image to decide if a hole is good or bad. We hypothesize that the location of image features within each hole (e.g. crystalline ice) is not important for classification. Rather, the presence, absence or proportion of these features is the main concern. Therefore, we compare between a standard CNN model that pads all input images to the same dimension and one which averages over non-channel dimensions of the final map before the fully connected layer, thereby treating the image as a bag of regions. Both CNNs normalize images based on pixels in the crop to control for difference in electron dose. Aside from the difference in padding versus average pooling, all other hyperparameters of the two models are identical. 3. Results and discussion Ptolemy can accurately locate and rank collection locations within low- and medium-magnification images, with each stage producing good performance metrics, and results that appear reasonable on visual inspection. Furthermore, Ptolemy generalizes well to new sessions without user intervention or retraining on a session-by-session basis. 3.1. Ptolemy localization of squares in low-magnification images The square localization algorithm successfully detects almost all operator-selected locations, as well as squares that were not collected, with few errors. Our algorithm successfully detects 98.8% of operator-selected locations (Table 1). An additional 30k unselected squares are detected, and visual inspection confirms that these are real squares that were not selected by the operator (Fig. 8). Table 1 Statistics from running the square localization procedure on lowmagnification images. No. of operator-selected locations 10993 No. of operator-selected locations detected 10857 Total no. of locations detected 41301 Table 2 Performance metrics of different ML models on the square classification task measured on held-out sessions and held-out square images. We compare the performance of LR, an RF and a CNN based on two metrics. ROC AUC: area under receiver-operating characteristic curve. Session split Random split Model ROC AUC Average precision ROC AUC Average precision LR 0.539 0.258 0.499 0.259 RF–5 feature 0.603 0.344 0.867 0.734 CNN 0.608 0.331 0.733 0.489 3.2. Square classifier learns to rank squares effectively For square classification, we explored three different models: an LR and RF on summary statistics (details in Appendix C) extracted from square images, and a CNN on the images themselves. Both the RF and the CNN perform similarly on this task. 3.2.1. Classifying squares for new sessions without prior knowledge. Square ranking without any information about the sample is a challenging task, but our models perform well and are significantly better than random guessing (Table 2). The task of ranking squares given the session split is particularly difficult, because the characteristics that make up good squares can vary from session to session. For optimum performance in this setting, a model would need to extract enough information from the square images to identify the optimal sample conditions and then predict the quality of the square accordingly. Although this is probably not possible for a classifier such as ours, which makes predictions for each square independently, we hypothesize that there are, at least, characteristics of squares that are always bad and maybe squares that are always good that can still provide useful Figure 8 Example square localizations on low-magnification images. Ptolemy successfully segments bounding boxes around squares in the grid without human intervention. ### research papers Figure 9 Example square classifications in low-magnification images. The model successfully prioritizes larger, brighter squares without cracks or contamination. Model-predicted probabilities for squares are in red. Colors from high to low score: dark blue, light blue, white, yellow, orange, red. guidance. The difficulty of this task is evident in comparison with the performance of the models on random splits of the data, where without the difficulty of generalizing to unseen sessions, the RF and CNN models perform significantly better (Table 2). Nonetheless, Ptolemy ranks squares significantly better than random guessing even in the session split setting. On visual inspection of predictions on held-out sessions, we find that the CNN makes reasonable predictions, with unbroken and larger squares prioritized over smaller, broken squares (Fig. 9). Additional example images with both model scores and user selection locations can be found in Fig. S4. 3.2.2. Simple extracted features exhibit good performance on square classification. The RF performing comparably to the CNN on an image classification task is a surprising result for which there are several possible explanations. First, examining the feature importance of the extracted features for the RF models, using feature permutation, shows that area and mean pixel intensity are the most important features for predicting whether a square was selected (Fig. 10). This result aligns with our expectations, as operators usually use area and brightness of squares as primary criteria for selection. We hypothesize that the importance of area as a feature may partly explain the good performance of the RF relative to the CNN, as area may be a feature that is difficult for a CNN to learn. Additionally, since our dataset is not exhaustively labeled, a more complex CNN model may be learning redundant, irrelevant features that do not generalize well from training set to test set. Nevertheless, the CNN does not require a burdensome computational cost (it runs very quickly on commodity CPU hardware), and likely has a higher potential performance if a larger and cleaner dataset is curated. We therefore use it as the default model for Ptolemy. 3.3. Ptolemy retrieves more holes with fewer false positives Next, we examine the performance of our methods for hole localization on medium-magnification images (Table 3). Since we do not have bounding box annotations for our dataset, we define a true positive as a model selection location that maps one-to-one with an operator-collected hole, a false negative as an operator-collected hole that contains zero or more than one (2+) model selection locations, and a false positive as a model selection location that is not contained in any operatorcollected holes, or is only contained in operator-collected holes that also contain other model selection locations. For more information on how we defined ‘model selection locations’ for each model in Table 3, see Appendix D. We find our U-Net, without lattice fitting, can learn operator-selected locations exceptionally well, and can identify 98.4% of all operator-selected holes with 70.3% precision (Table 3, row 2). We compare this method with the Yolov5based model trained by Yokoyama et al. (2020) on the same dataset and find that the U-Net is superior in both recall and precision (Redmon & Farhadi, 2018). Figure 10 Feature importance for square classification. Results obtained for feature importance of square image summary statistics to predict whether a square is selected using an RF model. Area and mean pixel intensity are the most important features. ### research papers Table 3 Performance metrics of different methods on held-out sessions for hole localization from medium-magnification images. Reported metrics are aggregated by session and averaged. Definitions of true positive, false positive and false negative used for computing precision, recall, and F1 can be found in Section 3.3 and Appendix D. Model Precision Recall F1 Yolov5 (from Yokoyama et al., 2020) 0.395 0.669 0.459 U-Net 0.703 0.984 0.815 U-Net + Lattice Fitting 0.549 0.993 0.702 U-Net + Lattice Fitting + Probability Threshold 0.802 0.891 0.837 3.3.1. Lattice fitting reduces false negative rate. With the addition of lattice fitting (Table 3, row 3), we reduce the false negative rate by a factor of 2, from 1.6% to 0.7%. Although the precision is also reduced with lattice fitting, we are primarily concerned with improving the false negative rate (1recall) as our aim is to recover all the holes at this stage. In the manual inspection, we find that the U-Net with lattice fitting correctly locates holes across diverse images (Fig. 11). Because many holes are not selected by the operators, we expect that, for the goal of detecting all holes (selected and not selected), lattice fitting is helpful. Additionally, only keeping lattice tiles based on a probability taken from the U-Net output (Table 3, row 4) significantly improves precision at the cost of recall. 3.3.2. U-Net + Lattice Fitting generalizes hole localization to an external dataset. To further test generalization, we predict holes in the dataset by Yokoyama et al. (2020) using our U-Net + Lattice Fitting model. Yokoyama et al. (2020) reported 95–97% recall of their own Yolov5 based model on these data. We find that the U-Net + Lattice Fitting model generalizes well, achieving 0.685 precision, 0.950 recall and 0.796 F1 score. The images in this dataset were collected from an external facility, using a different microscope (Ptolemy data were collected primarily on a TFS Krios and a Glacios; this dataset was collected on a JEM-Z300CF) and with different magnification compared with the images in our training dataset (Yokoyama et al., 2020), demonstrating that Ptolemy generalizes effectively. 3.4. Ptolemy successfully classifies holes in mediummagnification images after localization Next, we examine the performance of our hole classification models (Table 4). Both the padded model and the averagepool model perform well on the hole classification task. In example images, we see that the model can effectively separate good, unblemished holes from those with blemishes and artifacts on both gold and carbon grids (Fig. 12). 3.4.1. Average-pooling improves hole classification. The average-pool model slightly outperforms the padded model, which supports our hypothesis that the location in the image where features occur is not as important in determining hole quality, and that given the wide variance of hole sizes, a model that uses average pooling is preferable to padding all crops to the same size. Table 4 Performance of hole classification CNNs on hold-out sessions. ROC AUC: area under receiver operating characteristic curve. Model Accuracy ROC AUC Average precision CNN (padding) 0.748 0.742 0.808 CNN (average pool) 0.758 0.796 0.878 U-Net + Probability Threshold 0.846 0.868 0.867 3.4.2. Classifying holes using the localization U-Net output. We compare the dedicated CNN classifiers against the sum of the hole localization U-Net probabilities within a crop to determine the probability of picking a hole (Table 4, row 3). Surprisingly, the U-Net score outperforms the dedicated CNN classifiers in accuracy and ROC AUC. This is probably because the U-Net uses the context around the hole to help predict where the hole was collected from. The U-Net is deep to allow large holes to fit entirely within the receptive field of the bottleneck-layer neurons. This means that, for Figure 11 Examples of hole localization using the U-Net + Lattice Fitting. Ptolemy successfully detects all holes across a wide range of hole sizes, brightness and contrast conditions, from easily visible gold grids (bottom left) to very low contrast carbon grids that are difficult to see even for humans (top right). ### research papers Figure 12 Example hole classifications in medium-magnification images using the average-pooling model. Ptolemy can successfully prioritize complete holes free of contaminants. Model-predicted probabilities for holes are in red. Colors from high to low score: dark blue, light blue, white, yellow, orange, red. grids with smaller holes, the U-Net will have information about the location of the hole on the grid and the characteristics of nearby holes that our classifiers, which use only hole crops, lack. 3.5. Training and evaluating human operator selections One of the major challenges in developing Ptolemy is the lack of fully annotated data for training and assessment of model performance. We rely on training data composed of incomplete expert operator selections. These selections only represent an expert guess at the best collection locations and our models are trained to recapitulate these operator selection decisions as a surrogate for selecting high-quality data. Ideally, we would train and evaluate our models based on the true end goal of cryoEM data collection, particle quantity and quality, as determined by the resulting 3D structures, but these data are currently unavailable. Furthermore, the operators do not exhaustively select all possible viable collection locations. Since our model evaluation considers locations that the operator did not select as ground-truth negatives, the reported precision values are likely to underestimate the true precision of Ptolemy models. This lack of exhaustive selection also creates biases in the training data, especially on the hole and square classification tasks, which may be learned by our models. For example, due to the microscope setup at the SEMC/NYSBC, holes near the edge of medium-magnification images are often not collected even though they may be viable collection locations. 3.6. Future work A large fraction (the bulk majority at NYSBC) of cryoEM data-collection experiments involve gold or carbon holey grids generated via blotting and collected without tilting. Development, training and validation of Ptolemy were carried out with the goal of providing a system for automated collection on these grids. However, this leaves a long tail of less used but significant grid types and preparation methods for which future work is required. These include lacy grids, grids generated via spray or spotting methods, and tilted collection. Furthermore, Ptolemy currently lacks the ability to update its predictions dynamically to adjust to a given collection session. Ptolemy is designed to allow for modular improvement over time, so future updates of Ptolemy can build on the current set of algorithms to cover these cases as well. Tilted images can be corrected with basic image processing, as the angle of the tilt will be known in advance, and then the un-tilted images can be processed as normal. Grids generated by spray or spotting methods may need new purpose-built algorithms, but they may also be effectively handled by an on-the-fly learning algorithm. Lacy grids will likely require the most customization, including separate segmentation and prioritization algorithms at the medium-magnification level. 4. Conclusions Increasing throughput and reducing cost through automation is necessary to meet increasing demand for cryoEM. In this work, we present Ptolemy, an open-source, modular package ### research papers for automatic targeting and classification of cryoEM low- and medium-magnification images using purpose-designed computer vision and deep-learning algorithms. Ptolemy accurately localizes and ranks squares and holes in low- and medium-magnification images across a wide range of image and sample conditions. By training on large datasets of sparse microscope operator selection locations, the Ptolemy localization algorithms generalize to diverse gold and carbon holey grids and rank potential collection locations effectively without session-specific parameters, as we have demonstrated on held-out collection sessions within the SEMC/NYSBC dataset and on an independent dataset from another facility. Additionally, Ptolemy has been integrated with the microscope control software Leginon to enable automated data collection in real-life use cases (Cheng et al., 2022). Ptolemy is similar to the recent works SmartScope (Bouvette et al., 2022) and CryoRL (Li et al., 2022), which both offer automated collection capabilities. SmartScope focuses on automated screening and providing a helpful user interface to view and control screening in real time, whereas CryoRL focuses on optimizing the cryoEM data collection as a pathplanning problem and does not clearly address the square- and hole-detection problem. Both primarily repurpose existing deep-learning object detection and classification algorithms. Ptolemy, on the other hand, uses novel algorithms that are purpose-built for detection and classification of holes and squares in cryoEM images. Although Ptolemy identifies and generally ranks ROIs remarkably well, it is unable to incorporate session-specific information to reprioritize targets on-the-fly. In future work, we plan to use the current Ptolemy classification models as prior models, and dynamically update these prior models during each collection session based on the quality of highestmagnification exposures that are collected from explored squares and holes in an active-learning framework. Ptolemy is a significant advance in the automation of cryoEM data collection, allowing for fully unattended data collection, and increasing microscope and operator efficiency. To accelerate cryoEM collection for the whole community, Ptolemy is open source and freely available for academic use at https://github.com/SMLC-NYSBC/ptolemy. We anticipate that Ptolemy will become an integral part of the data-collection pipeline and will serve as the basis for future work in cryoEM automation. The supporting information file pw5021sup1.xlsx contains the metadata for the various data-collection sessions used to train and test the models in Ptolemy. APPENDIX A Ptolemy implementation details and default models Ptolemy is an operating system and microscope control software agnostic and requires only Python (3+) and a few installed packages to run. Package dependencies can be found in the github repository at https://github.com/SMLC-NYSBC/ ptolemy. By default, Ptolemy is configured to use the mixture model for low-magnification square detection, the CNN for low-magnification square classification, the U-Net with grid fitting for medium-magnification hole detection and the average-pooled CNN for medium-magnification hole classification. It runs fully on CPU and requires a maximum of only 2.7 GB RAM to detect and classify squares in a low-magnification image and 3.6 GB RAM to detect and classify holes in a medium-magnification image. After installation, running Ptolemy during data collection involves the following steps. (1) Microscope control software captures tiled low-magnification mrc(s) of the grid and saves the file. (2) Call python lowmag_cli.py (path to low-magnification mrc). This returns a JSON containing a list of dictionaries with the fields (i) vertices corresponding to vertex coordinates of squares, (ii) center corresponding to the centers of squares, (iii) area corresponding to areas of squares, (iv) brightness corresponding to mean brightness of pixels in squares, (v) score corresponding to CNN predicted score (between 0 and 1) of squares. (3) Use the output coordinates and scores to select the collection location(s) to collect medium-magnification images. (4) Microscope control software captures medium-magnification mrc(s) within squares and saves to file. (5) Call python medmag_cli.py (path to mediummagnification mrc). This returns a JSON containing a list of dictionaries with the fields (i) vertices corresponding to vertex coordinates of hole crops, (ii) center corresponding to the centers of holes, (iii) area corresponding to areas of hole crops, (iv) score corresponding to CNN predicted score (between 0 and 1) of holes. (6) Use the output coordinates and scores to select the collection location(s) to collect the highest-magnification exposures. (7) Return to step (3) to explore new medium-magnification collection locations from existing low-magnification images, or step (1) to select new low-magnification collection locations. For an example of integrating Ptolemy into cryoEM datacollection software in practice, please refer to the companion paper to Ptolemy, ‘Fully automated multi-grid CryoEM screening using Smart Leginon’ (Cheng et al., 2022). APPENDIX B Training and hyperparameters All deep-learning and machine-learning models were trained using default hyperparameters in PyTorch (Paszke et al., 2019) and scikit-learn (Pedregosa et al., 2011) except where stated otherwise. All deep-learning model parameters were fitted with the default Adam, except for the sigma parameter of the Gaussian smoothing, which was initialized to e and trained with an Adam optimizer with a learning rate of 0.1 (Kingma & Ba, 2017). Binary-cross-entropy loss was used for all deeplearning models, and for the U-Net a positive weight of 100 was applied. The square classification CNN was trained for two epochs and used two 5 � 5 convolutional layers followed by three 3 � 3 convolutional layers, with 64 channels per layer and with a batch size of 128, whereas the hole classification CNN was trained for five epochs and used one 5 � 5 convolutional layer, followed by three 3 � 3 convolutional layers with 128 channels per layer, with a batch size of 32. Both models used batch normalization, max-pooling and ReLU activations (LeCun et al., 2015; Ioffe & Szegedy, 2015). The U-Net for hole localization was trained for 6000 steps and used nine down-blocks and nine up-blocks, with each down-block and up-block using a 64 channel 3 - 3 kernel convolutional layer. The model also used ReLU activations for down- and up-blocks, max-pooling for downsampling in down-blocks, and nearest interpolation for upsampling in upblocks. Batch norm was not used. Also, the bias of the final convolutional layer which produces the final output of the model was initialized at �10 to allow the model to initially predict all or mostly zeros in the output, since the target image contains zeros everywhere except for the few pixel locations where the operator made a selection. Random 90 <sup>�</sup> rotation augmentation is applied while training square and hole classification CNNs. Random 90 <sup>�</sup> rotation augmentation is combined with random pixel inversion when training the U-Net for hole localization. APPENDIX C Random forest and logistic regression model details The RF and LR models were trained on the following features for the squares: mean pixel intensity, maximum pixel intensity, minimum pixel intensity, variance of pixel intensities, skew of pixel intensities, kurtosis of pixel intensities and area. Default hyperparameters from scikit-learn were used for both models. APPENDIX D Definition of ‘predicted collected regions’ for each model For U-Net + Lattice Fitting, crops are generated by creating squares centered at each lattice point with a side length equal to dl � 60, where dl is the distance between lattice points. All crops are considered predicted collected regions. For U-Net alone, circles with a radius of 50 pixels around each centroid of high-probability regions in the U-Net output map are considered predicted collected regions. For U-Net + Lattice Fitting + Probability Threshold, we generated crops like in U-Net + Lattice Fitting, but then only kept the crops where the sum of pixel probabilities outputted by the U-Net within the crop was greater than 0.5. For the Yolov5 model in Yoneo-Locr, which outputs many bounding boxes at different confidence levels, we had to decide how to set confidence thresholds which determine the bounding boxes that are kept. We aimed to be generous to the model by picking the confidence threshold that gave the maximum F1 score for each image independently and keeping all bounding boxes in that image that were predicted with confidence greater than this threshold. ### research papers Acknowledgements We thank the SEMC Electron Microscopy Staff for their help in testing algorithms and models, in particular Mahira Aragon, Eugene Chua, Huihui Kuang, Kashyap Maruthi, Joshua Mendez, Anjelique Sawh and Hui Wei. Additionally, we thank Tohru Terada for providing us with hole localization data from Yokoyama et al. (2020). Finally, we thank members of the SEMC at NYSBC, in particular Bridget Carragher and Clint Potter, for useful discussions. Funding information This work was performed at the Simons Electron Microscopy Center located at the New York Structural Biology Center, supported by grants from the Simons Foundation (grant No. SF349247) and NIH National Institute of General Medical Sciences (grant No. GM103310). References Bai, X., McMullan, G. & Scheres, S. H. W. (2015). Trends Biochem. Sci. [40,](http://scripts.iucr.org/cgi-bin/cr.cgi?rm=pdfbb&cnor=pw5021&bbid=BB1) 49–57. [Bepler, T., Morin, A., Rapp, M., Brasch, J., Shapiro, L., Noble, A. J. &](http://scripts.iucr.org/cgi-bin/cr.cgi?rm=pdfbb&cnor=pw5021&bbid=BB2) Berger, B. (2019). [Nat. Methods, 16, 1153–1160.](http://scripts.iucr.org/cgi-bin/cr.cgi?rm=pdfbb&cnor=pw5021&bbid=BB2) Bouvette, J., Huang, Q., Riccio, [A.](http://scripts.iucr.org/cgi-bin/cr.cgi?rm=pdfbb&cnor=pw5021&bbid=BB3) A., Copeland, W. C., Bartesaghi, A. & Borgnia, M. J. [(2022).](http://scripts.iucr.org/cgi-bin/cr.cgi?rm=pdfbb&cnor=pw5021&bbid=BB3) eLife, 11, e80047. [Brent, R. P. (1973). Algorithms for Minimization Without Derivatives,](http://scripts.iucr.org/cgi-bin/cr.cgi?rm=pdfbb&cnor=pw5021&bbid=BB4) 1st ed. Englewood [Cliffs:](http://scripts.iucr.org/cgi-bin/cr.cgi?rm=pdfbb&cnor=pw5021&bbid=BB4) Prentice-Hall. [Carragher, B., Kisseberth, N., Kriegman, D., Milligan, R. A., Potter, C.](http://scripts.iucr.org/cgi-bin/cr.cgi?rm=pdfbb&cnor=pw5021&bbid=BB5) S., Pulokas, J. & Reilein, [A. (2000).](http://scripts.iucr.org/cgi-bin/cr.cgi?rm=pdfbb&cnor=pw5021&bbid=BB5) J. Struct. Biol. 132, 33–45. Cheng, A., Kim, P. T., Kuang, [H.,](http://scripts.iucr.org/cgi-bin/cr.cgi?rm=pdfbb&cnor=pw5021&bbid=BB6) Mendez, J. H., Chua, E. Y. D., Maruthi, K., Wei, H., Sawh, A., [Aragon,](http://scripts.iucr.org/cgi-bin/cr.cgi?rm=pdfbb&cnor=pw5021&bbid=BB6) M. F., Serbynovskyi, V., Neselu, K., Eng, E. T., Potter, [C.](http://scripts.iucr.org/cgi-bin/cr.cgi?rm=pdfbb&cnor=pw5021&bbid=BB6) P., Carragher, B., Bepler, T. & Noble, A. J. [(2022).](http://scripts.iucr.org/cgi-bin/cr.cgi?rm=pdfbb&cnor=pw5021&bbid=BB6) IUCrJ, 9, 77–89. [Cheng, Y., Grigorieff, N., Penczek, P. A. & Walz, T. (2015). Cell, 161,](http://scripts.iucr.org/cgi-bin/cr.cgi?rm=pdfbb&cnor=pw5021&bbid=BB8) [438–449.](http://scripts.iucr.org/cgi-bin/cr.cgi?rm=pdfbb&cnor=pw5021&bbid=BB8) Chua, E. Y. D., Mendez, J. H., [Rapp,](http://scripts.iucr.org/cgi-bin/cr.cgi?rm=pdfbb&cnor=pw5021&bbid=BB9) M., Ilca, S. L., Tan, Y. Z., Maruthi, K., Kuang, H., [Zimanyi,](http://scripts.iucr.org/cgi-bin/cr.cgi?rm=pdfbb&cnor=pw5021&bbid=BB9) C. M., Cheng, A., Eng, E. T., Noble, A. J., Potter, C. S. & [Carragher,](http://scripts.iucr.org/cgi-bin/cr.cgi?rm=pdfbb&cnor=pw5021&bbid=BB9) B. (2022). Annu. Rev. Biochem. 91, 1–32. Egelman, E. H. (2016). [Biophys.](http://scripts.iucr.org/cgi-bin/cr.cgi?rm=pdfbb&cnor=pw5021&bbid=BB10) J. 110, 1008–1012. Forbes, F. (2018). Mixture [Models](http://scripts.iucr.org/cgi-bin/cr.cgi?rm=pdfbb&cnor=pw5021&bbid=BB11) for Image Analysis, edited by S. Fruhwirth-Schnatter, G. Celeux [&](http://scripts.iucr.org/cgi-bin/cr.cgi?rm=pdfbb&cnor=pw5021&bbid=BB11) C. P. Robert, pp. 397–418. New York: [CRC](http://scripts.iucr.org/cgi-bin/cr.cgi?rm=pdfbb&cnor=pw5021&bbid=BB11) press. [George, B., Assaiya, A., Roy, R. J., Kembhavi, A., Chauhan, R., Paul,](http://scripts.iucr.org/cgi-bin/cr.cgi?rm=pdfbb&cnor=pw5021&bbid=BB12) G., Kumar, J. & Philip, N. S. [(2021).](http://scripts.iucr.org/cgi-bin/cr.cgi?rm=pdfbb&cnor=pw5021&bbid=BB12) Commun. Biol. 4, 200. Gupta, L. & Sortrakul, T. [(1998).](http://scripts.iucr.org/cgi-bin/cr.cgi?rm=pdfbb&cnor=pw5021&bbid=BB13) Pattern Recognit. 31, 315–325. Ioffe, S. & Szegedy, C. [(2015).](http://scripts.iucr.org/cgi-bin/cr.cgi?rm=pdfbb&cnor=pw5021&bbid=BB14) arXiv:150203167. Kingma, D. P. & Ba, [J. (2017).](http://scripts.iucr.org/cgi-bin/cr.cgi?rm=pdfbb&cnor=pw5021&bbid=BB15) arXiv:14126980. LeCun, Y., Bengio, Y. [& Hinton,](http://scripts.iucr.org/cgi-bin/cr.cgi?rm=pdfbb&cnor=pw5021&bbid=BB16) G. (2015). Nature, 521, 436–444. Li, Y., Cash, J. N., Tesmer, J. J. G. & Cianfrocco, M. A. (2020). [Structure, 28,](http://scripts.iucr.org/cgi-bin/cr.cgi?rm=pdfbb&cnor=pw5021&bbid=BB17) 858–869.e3. [Li, Y., Fan, Q., Cohn, J., Demers, V., Lee, J. Y., Yip, L., Cianfrocco, M.](http://scripts.iucr.org/cgi-bin/cr.cgi?rm=pdfbb&cnor=pw5021&bbid=BB18) A. & Vos, S. M. (2022). [bioRxiv,](http://scripts.iucr.org/cgi-bin/cr.cgi?rm=pdfbb&cnor=pw5021&bbid=BB18) 2022.06.17.496614. Lyumkis, D. (2019). [J. Biol.](http://scripts.iucr.org/cgi-bin/cr.cgi?rm=pdfbb&cnor=pw5021&bbid=BB19) Chem. 294, 5181–5197. Mastronarde, D. N. [(2005).](http://scripts.iucr.org/cgi-bin/cr.cgi?rm=pdfbb&cnor=pw5021&bbid=BB20) J. Struct. Biol. 152, 36–51. [Noble, A. J., Dandey, V. P., Wei, H., Brasch, J., Chase, J., Acharya, P.,](http://scripts.iucr.org/cgi-bin/cr.cgi?rm=pdfbb&cnor=pw5021&bbid=BB21) [Tan, Y. Z., Zhang, Z., Kim, L. Y., Scapin, G., Rapp, M., Eng, E. T.,](http://scripts.iucr.org/cgi-bin/cr.cgi?rm=pdfbb&cnor=pw5021&bbid=BB21) Rice, W. J., Cheng, A., Negro, [C.](http://scripts.iucr.org/cgi-bin/cr.cgi?rm=pdfbb&cnor=pw5021&bbid=BB21) J., Shapiro, L., Kwong, P. D., [Jeruzalmi, D., des Georges, A., Potter, C. S. & Carragher, B. (2018).](http://scripts.iucr.org/cgi-bin/cr.cgi?rm=pdfbb&cnor=pw5021&bbid=BB21) eLife, [7, e34257.](http://scripts.iucr.org/cgi-bin/cr.cgi?rm=pdfbb&cnor=pw5021&bbid=BB21) Paszke, A., Gross, S., Massa, F., [Lerer,](http://scripts.iucr.org/cgi-bin/cr.cgi?rm=pdfbb&cnor=pw5021&bbid=BB501) A., Bradbury, J., Chanan, G., Killeen, T., Lin, Z., [Gimelshein,](http://scripts.iucr.org/cgi-bin/cr.cgi?rm=pdfbb&cnor=pw5021&bbid=BB501) N., Antiga, L., Desmaison, A., Ko¨pf, A., Yang, E., DeVito, Z., Raison, M., Tejani, A., Chilamkurthy, S., Steiner, B., [Fang,](http://scripts.iucr.org/cgi-bin/cr.cgi?rm=pdfbb&cnor=pw5021&bbid=BB501) L., Bai, J. & Chintala, S. ### research papers (2019). Advances in Neural [Information](http://scripts.iucr.org/cgi-bin/cr.cgi?rm=pdfbb&cnor=pw5021&bbid=BB501) Processing Systems 32, edited by H. Wallach, H. [Larochelle,](http://scripts.iucr.org/cgi-bin/cr.cgi?rm=pdfbb&cnor=pw5021&bbid=BB501) A. Beygelzimer, F. d’Alche´Buc, E. Fox & R. Garnett, pp. [8026–8037.](http://scripts.iucr.org/cgi-bin/cr.cgi?rm=pdfbb&cnor=pw5021&bbid=BB501) Curran Associates Inc. Pedregosa, F., Varoquaux, G., [Gramfort,](http://scripts.iucr.org/cgi-bin/cr.cgi?rm=pdfbb&cnor=pw5021&bbid=BB502) A., Michel, V., Thirion, B., Grisel, O., Blondel, M., [Prettenhofer,](http://scripts.iucr.org/cgi-bin/cr.cgi?rm=pdfbb&cnor=pw5021&bbid=BB502) P., Weiss, R., Dubourg, V., [Vanderplas, J., Passos, A., Cournapeau, D., Brucher, M., Perrot, M.](http://scripts.iucr.org/cgi-bin/cr.cgi?rm=pdfbb&cnor=pw5021&bbid=BB502) & Duchesnay, E <sup>´</sup> . (2011). [J. Mach.](http://scripts.iucr.org/cgi-bin/cr.cgi?rm=pdfbb&cnor=pw5021&bbid=BB502) Learn. Res. 12, 2825–2830. [Punjani, A., Rubinstein, J., Fleet, D. & Brubaker, M. A. (2017). Nat.](http://scripts.iucr.org/cgi-bin/cr.cgi?rm=pdfbb&cnor=pw5021&bbid=BB22) [Methods, 14,](http://scripts.iucr.org/cgi-bin/cr.cgi?rm=pdfbb&cnor=pw5021&bbid=BB22) 290–296. Redmon, J. & Farhadi, [A. (2018).](http://scripts.iucr.org/cgi-bin/cr.cgi?rm=pdfbb&cnor=pw5021&bbid=BB23) arXiv:180402767. Ronneberger, O., Fischer, P. & [Brox,](http://scripts.iucr.org/cgi-bin/cr.cgi?rm=pdfbb&cnor=pw5021&bbid=BB24) T. (2015). arXiv:150504597. Sanchez-Garcia, R., Segura, J., [Maluenda,](http://scripts.iucr.org/cgi-bin/cr.cgi?rm=pdfbb&cnor=pw5021&bbid=BB25) D., Sorzano, C. O. S. & Carazo, J. M. (2020). [J. Struct.](http://scripts.iucr.org/cgi-bin/cr.cgi?rm=pdfbb&cnor=pw5021&bbid=BB25) Biol. 210, 107498. Shorten, C. [& Khoshgoftaar, T.](http://scripts.iucr.org/cgi-bin/cr.cgi?rm=pdfbb&cnor=pw5021&bbid=BB26) M. (2019). J. Big Data, 6, 60. [Suloway, C., Pulokas, J., Fellmann, D., Cheng, A., Guerra, F., Quispe,](http://scripts.iucr.org/cgi-bin/cr.cgi?rm=pdfbb&cnor=pw5021&bbid=BB27) [J., Stagg, S., Potter, C. S. & Carragher, B. (2005). J. Struct. Biol. 151,](http://scripts.iucr.org/cgi-bin/cr.cgi?rm=pdfbb&cnor=pw5021&bbid=BB27) [41–60.](http://scripts.iucr.org/cgi-bin/cr.cgi?rm=pdfbb&cnor=pw5021&bbid=BB27) Tegunov, D. [& Cramer, P. (2019).](http://scripts.iucr.org/cgi-bin/cr.cgi?rm=pdfbb&cnor=pw5021&bbid=BB28) Nat. Methods, 16, 1146–1152. Wagner, T., Merino, F., [Stabrin,](http://scripts.iucr.org/cgi-bin/cr.cgi?rm=pdfbb&cnor=pw5021&bbid=BB30) M., Moriya, T., Antoni, C., Apelbaum, A., Hagel, P., [Sitsel,](http://scripts.iucr.org/cgi-bin/cr.cgi?rm=pdfbb&cnor=pw5021&bbid=BB30) O., Raisch, T., Prumbaum, D., Quentin, D., Roderer, D., [Tacke,](http://scripts.iucr.org/cgi-bin/cr.cgi?rm=pdfbb&cnor=pw5021&bbid=BB30) S., Siebolds, B., Schubert, E., Shaikh, T. R., Lill, P., [Gatsogiannis,](http://scripts.iucr.org/cgi-bin/cr.cgi?rm=pdfbb&cnor=pw5021&bbid=BB30) C. & Raunser, S. (2019). Commun. [Biol.](http://scripts.iucr.org/cgi-bin/cr.cgi?rm=pdfbb&cnor=pw5021&bbid=BB30) 2, 218. Weissenberger, G., Henderikx, [R.](http://scripts.iucr.org/cgi-bin/cr.cgi?rm=pdfbb&cnor=pw5021&bbid=BB31) J. M. & Peters, P. J. (2021). Nat. Methods, [18,](http://scripts.iucr.org/cgi-bin/cr.cgi?rm=pdfbb&cnor=pw5021&bbid=BB31) 463–471. Wu, M. & Lander, G. C. [(2020).](http://scripts.iucr.org/cgi-bin/cr.cgi?rm=pdfbb&cnor=pw5021&bbid=BB32) Biophys. J. 119, 1281–1289. Yokoyama, Y., Terada, T., [Shimizu,](http://scripts.iucr.org/cgi-bin/cr.cgi?rm=pdfbb&cnor=pw5021&bbid=BB33) K., Nishikawa, K., Kozai, D., Shimada, A., Mizoguchi, A., [Fujiyoshi,](http://scripts.iucr.org/cgi-bin/cr.cgi?rm=pdfbb&cnor=pw5021&bbid=BB33) Y. & Tani, K. (2020). Biophys. [Rev.](http://scripts.iucr.org/cgi-bin/cr.cgi?rm=pdfbb&cnor=pw5021&bbid=BB33) 12, 349–354. Zhong, E. D., Bepler, T., [Berger,](http://scripts.iucr.org/cgi-bin/cr.cgi?rm=pdfbb&cnor=pw5021&bbid=BB34) B. & Davis, J. H. (2021). Nat. Methods, [18,](http://scripts.iucr.org/cgi-bin/cr.cgi?rm=pdfbb&cnor=pw5021&bbid=BB34) 176–185.

섹션 본문 39문단 · 26,887자

(제목 없음)

1Over the past decade, cryogenic electron microscopy (cryo-EM) has emerged as a primary method for determining near-native, near-atomic resolution 3D structures of biological macromolecules.In order to meet increasing demand for cryo-EM, automated methods to improve throughput and efficiency while lowering costs are needed.Currently, all high-magnification cryo-EM data collection softwares require human input and manual tuning of parameters.Expert operators must navigate low-and medium-magnification images to find good high-magnification collection locations.Automating this is non-trivial: the images suffer from low signal-to-noise ratio and are affected by a range of experimental parameters that can differ for each collection session.Here, we use various computer vision algorithms, including mixture models, convolutional neural networks, and U-Nets to develop the first pipeline to automate low-and medium-magnification targeting.Learned models in this pipeline are trained on a large internal dataset of images from real world cryo-EM data collection sessions, labeled with locations that were selected by operators.Using these models, we show that we can effectively detect and classify regions of interest in low-and medium-magnification images, and can generalize to unseen sessions, as well as to images captured using different microscopes from external facilities.We expect our open-source pipeline, Ptolemy, will be both immediately useful as a tool for automation of cryo-EM data collection, and serve as a foundation for future advanced methods for efficient and automated cryo-EM microscopy.

Introduction

2A cryo-EM study typically involves application of a solution containing purified protein to a thin metal wafer called an EM grid, vitreously freezing the sample on the grid, and imaging the ice in this grid to collect high-magnification micrographs containing 2D projections of the protein particles. 1,2In order to coherently collect high-magnification micrographs, the microscope's magnification must be successively increased several orders of magnitude.4][5] This presents a significant limitation to the throughput of the expensive and in-demand cryo-EM microscopes, while also significantly reducing the efficiency of operators' time.A fully automated method is therefore needed to increase access and throughput.

3However, automating the full cryo-EM data collection process is challenging.EM grids are often made from different materials, particularly carbon and gold, which causes the resulting images to have very different properties.Carbon grids, for example, have limited contrast between regions of interest (ROIs) and background.The grids can also have deformations and contaminations which introduce visual artifacts.Meanwhile, microscope parameters such as electron beam dose can significantly alter image properties such as average pixel intensity. 6dditionally, cryo-EM images have low signal-to-noise ratio, and images at each magnification level may contain many separate ROIs, or none at all. 7Simple rastering algorithms based on correlation allow for some of these targeting routines to be automated, but they require manual tuning for each collection session and often produce many false positives and true negatives. 4,8Moreover, these rastering algorithms lack extendability for iteratively integrating new information into targeting decisions.Here, we present Ptolemy, the first pipeline that uses computer vision algorithms and convolutional neural networks (CNNs) to navigate cryo-EM grids and determine optimal targeting locations without human input.We train the models in Ptolemy on a large dataset of low-and medium-mag images with corresponding operator targeting locations, collected from over 50 different data collection sessions.These sessions include carbon and gold holey grids and feature a variety of proteins, grid conditions, and electron beam dosages.Rather than attempting to learn separate models for different grid types or for different particles, we develop a single unified pipeline to localize and classify regions of interest in low-and medium-mag cryo-EM images (Figure 1).

4We demonstrate that Ptolemy is able to effectively detect and classify low-magnification and medium-magnification ROIs, termed "squares" and "holes" respectively.We evaluate these predictions by analyzing whether these locations were selected by operators.We validate the model by holding-out entire data collection sessions to confirm that the model generalizes well to unseen sessions.Additionally, while no current methods exist for low-mag detection or classification, we compare our medium-mag localization algorithm to an existing method from Yokoyama et al. 9 We show that our method yields superior generalization performance.

5Ptolemy is under active development.We make our source code freely available for academic use at (https://github.com/SMLC-NYSBC/ptolemy).

Methods

6In order to automate microscope targeting for single-particle cryo-EM data collection, we divide the problem into four sub-problems:

7-Low-mag (Square) localization -Low-mag (Square) classification -Med-mag (Hole) localization -Med-mag (Hole) classification For low-and medium-mag localization, the goal is to identify all possible ROIs.The cropped ROIs are then fed into separate classification models at each level that determine whether these ROIs should be collected or not.Low-mag localization is solved by pixelwise image segmentation using a mixture model, while medium-mag localization is performed using a U-Net and a novel lattice fitting algorithm. 10,11Classification at low-magnifications is done using a feedforward CNN while medium-magnification classification uses the U-Net localization probabilities because they outperformed a separate downstream classifier in our tests. 9All data used to train and validate the models comes from 55 data collection sessions performed at the New York Structural Biology Center (NYSBC) from 2018-2021.Training and hyperparameter information for all trained models can be found in Appendix section S2.

8Square Localization.The goal of square localization is to locate all squares (regions that may contain imageable ice) in low-mag grid images.The input is a low-mag image, and the output is a set of boxes tightly bounding the squares (Figure 2).We approach this problem using a mixture model segmentation.Pixels in the image are first separated into two classes based on pixel intensity, using a Poisson mixture model (Figure 2B). 13This separation works because the distribution of pixels in the image can be decomposed into low-intensity pixels coming from the thick grid bars in the surrounding background and higher-intensity pixels coming from the much thinner squares (Appendix Figure S1).Next, we apply a flood filling algorithm to generate discrete groups from the square pixels, then find a minimum bounding convex polygon to bound the pixels in each square (Figure 2C).Finally, we take advantage of the fact that the squares are axis-aligned to find the angle, , for each low-mag image for which the minimum θ bounding boxes (rectangles) aligned with bounding each polygon have the smallest total area.More formally, we θ seek , for polygons, where is the area of the minimum bounding rectangle around the 'th

9polygon, aligned at angle .We find this angle θ using bounded optimization, and the resulting minimum bounding θ rectangles are used to obtain crops of the squares in the low-mag image (Figure 2D). 14This algorithm is applied to 1,304 low-mag images, resulting in 41k crops of squares.

10Hole Localization.The goal of hole localization is to detect all hole locations in medium-mag images.However, unlike in square localization, a mixture model based segmentation approach does not work because, particularly for carbon grids, the difference in pixel intensities between the holes and the surrounding background is negligible.

11Here, our choice of model was informed by the available data.Although we did not have a dataset of bounding boxes around holes, we did have a large dataset of 28k carbon and gold holey grid medium-mag images with the corresponding locations at or near the center of holes where the operators collected high-mag images.Therefore, we sought to learn the hole centers in a given pixel-normalized medium-mag input image by training a U-Net model to output a map with the same dimensions as the input, with 1s at the locations where the operator collected and 0s everywhere else (Figures 3 & 4).We choose a U-Net architecture here because the neurons in the bottleneck layer can have the entire hole circle in their receptive fields, while the output layers can use the information propagated from the bottleneck, as well as from the original input image, to find the hole centers.Additionally, the holes in a grid are known to lie on a square lattice, so we post-process the output of the U-Net by finding anchor points for this lattice, then finding all lattice points in the image and cropping around those points (Figure 5).This helps to extend the predicted map from the U-Net to capture all holes in the image, not just the holes that the operators picked, while simultaneously cleaning erroneously detected regions.We find the lattice from the U-Net output map by searching pairs of candidate anchor points and selecting the pair for which the lattice produced by these anchor points has the smallest pixelwise error against the output map.More formally, we find To improve training, we apply a Gaussian blur to the model output before computing the loss. 15This helps because the exact location the operator selects in a hole is somewhat arbitrary -the selection location is near the center of the hole but there is often a slight deviation from the exact center pixel, and the direction and magnitude of displacement from the center varies between medium-mag images.Therefore, this smoothing allows the model to learn the centers of these holes, rather than having to learn the displacement from the center for every hole image.We also perform gradient descent on the sigma parameter of the Gaussian blur simultaneously while training the U-Net weights to allow the model to learn the optimal level of smoothing over training time.

12Finally, to improve generalization, we apply both random 90-degree rotation augmentations to the images during training as well as random inversion of the normalized pixels.In particular, inversion of pixels is helpful because for some sessions, particularly with carbon grids, the pixels in the holes are darker than the background pixels (Figure 9).While pixel inversion augmentation allows for better carbon grid hole targeting, it does not affect gold grid images which do not suffer from contract inversions.

Square Classification Model and Hole Classification Model.

13In square and hole classification, we aim to obtain rankings of squares and holes in images to prioritize the ordering with which they are targeted.While there are many possible parameters that may be important in determining whether a square or hole contains high-quality particles, experienced operators are able to consistently find good locations.Therefore, for each magnification we train a separate CNN to classify squares or holes as collected or not collected by operators.The input to our model is a cropped image of a square or hole, extracted using the square-localization method or hole-localization method above, and the output is a scalar probability.

14For square classification, our model was trained on a dataset containing 41k square crops, of which 11k were collected squares.Normalization of square pixels is done based on the intensity of all pixels within square bounding boxes in the low-mag image.We also include baseline random forest (RF) and logistic regression (LR) models trained on summary statistics of the pixels extracted from the square image crops.This is because the operators typically use characteristics like the size/area and brightness of the squares to make their selections, therefore we included baselines which reflect this knowledge.The summary statistics used as features are: mean intensity, max intensity, min intensity, variance intensity, kurtosis, skew, and crop area.

15For hole classification, we compare the summed pixelwise probabilities output by our localization U-net within each hole to two CNNs.The CNNs were trained on a dataset containing 571k hole crops, of which 410k were targeted by operators.The dimensions of the holes, and therefore the dimensions of the resulting crops, vary widely between data collection sessions.However, we do not want the model to use the size of the input image to decide if a hole is good or bad.Additionally, for the hole classification problem, we hypothesize that the specific location in the hole crop where the image features (for example, contaminants in ice) occur is not as important as the presence or absence of those features.Therefore, we compare between a standard CNN model that pads all input images to the same dimension vs one which averages over non-channel-dimensions of the final map before the fully connected layer, thereby treating the image as a bag of regions.Both CNNs normalize images based on pixels in the crop.Besides the difference in padding versus average pooling, all other hyperparameters of the two models are identical.

Results

16Ptolemy performs well overall, with each stage producing good performance metrics, and results that appear reasonable upon visual inspection.For steps involving trained models -square classification, hole localization, and hole classification -we report results on validation sets composed of images from held-out sessions.This allows us to evaluate generalizability for the real-world scenario of data collection for a new session which may involve previously unseen experiment parameters.

17Our reported metrics treat operator selections from real-world data collection events as ground-truth.However, the operators do not exhaustively select all possible viable collection locations.Therefore, the reported precision values are an underestimate of the true precision.

Square localization successfully finds squares in low-mag images.

18The square localization algorithm successfully detects almost all operator selected locations, as well as squares that were not collected, with few errors.Our algorithm is able to successfully detect 98.8% of operator selected locations (Table 1).An additional 30k unselected ROIs are detected, and upon visual inspection we find that the algorithm is successfully detecting squares that were not selected by the operator (Figure 6).Square classifier learns to rank squares.For square classification, we explored three different models -a logistic regression and random forest (RF) on summary statistics (details in Appendix section S3) extracted from square images, and a CNN on the images themselves.Both the RF and the CNN perform similarly on this task.The metrics indicate reasonable performance, which are likely to be lower-bounds on the actual performance, as our dataset does not contain an exhaustive annotation of all good squares (Table 2).Additionally, splitting squares based on session is challenging, because the characteristics that make up good squares can vary from session to session.Therefore, learning a single model that works across sessions is difficult.This is evident by the performance of the models on random splits of the data, where in absence of the difficulty of generalizing to unseen sessions, the RF and CNN models perform significantly better (Table 2).Examining the feature importance of the extracted features for the RF models, using feature permutation, shows that area is the most important feature for predicting whether a square was selected or not, with maximum pixel intensity and skew being possible secondary features (Figure 7).This result aligns with our expectations, as operators usually use area and brightness of squares as primary criteria for selection.We hypothesize that the importance of area as a feature may also explain the good performance of the RF relative to the CNN, as area may be a feature that is difficult for a convolutional neural network to learn.

19Upon visual inspection of predictions on validation sessions, we find that the CNN makes reasonable predictions, with unbroken and larger squares prioritized over smaller, broken squares (Figure 8).Example images with model scores and user selection locations can be found in Appendix Section S4.Colors from high to low score: dark blue, light blue, white, yellow, orange, red.

20Ptolemy retrieves more holes and with fewer false positives.Next, we examine the performance of our methods for hole localization from medium-magnification images (Table 3).Since we do not have bounding box annotations for our dataset, we define a true positive as a selected location that is mapped one-to-one with a predicted collection region, a false positive as a predicted collection region that contains none or multiple selected locations, and a false negative as a selected location that is not contained in any predicted collection regions, or is only contained in "bad" predicted collection regions that also contain other selected locations.For more information on how we defined "predicted collection regions" for each model in Table 3, see Appendix Section S1.We find that our U-Net, without lattice fitting, learns operator selected locations exceptionally well, and can identify 98.4% of all operator selected holes with 70.3% precision (Table 3, row 2).We compare this method to the Yolov5-based model trained by Yokoyama et al. on the same dataset and find that the U-Net is superior in both recall and precision. 9,16attice Fitting reduces false negative rate.With the addition of lattice fitting (Table 3, Row 3) we can reduce the false negative rate by a factor of 2, from 1.6% to 0.7%.Although the precision is reduced with lattice fitting, we are primarily concerned with reducing the false negative rate as our aim is to recover all of the holes at this stage.Furthermore, because many holes are not selected by the operators, we expect that for the goal of detecting all holes -selected and not selected -lattice fitting is helpful.Additionally, only keeping lattice tiles based on a probability taken from the U-Net output (Table 3 Row 4) significantly improves precision but at the cost of recall.Average-Pooling final layer improves hole classification performance.We inspect the performance of our hole classification models (Table 4).Both the padded model and the average-pool model perform well on the hole classification task.However, we find that the average-pool model slightly outperforms the padded model, which supports our intuition that the location in the image where features occur is not as important in determining hole quality, and that given the wide variance of hole sizes, a model that uses average pooling is preferable to padding all crops to the same size.The classification model is able to effectively separate good, unblemished holes from those with blemishes and artifacts, on both gold and carbon grids (Figure 11).In particular, the model clearly avoids holes obstructed by ice contamination.Additionally, the model learns a bias against holes on the border of the image that are cut off, because in data collection, these holes are seldom collected.Classifying holes using the localization U-Net output improves performance.Lastly, we compare against a classifier made by using the sum of U-Net probabilities within a crop to determine the probability of picking a hole (Table 4, Row 3).Surprisingly, this classifier outperforms the dedicated CNN classifiers in accuracy and ROC AUC.This is likely because the U-Net can use the context around the hole to help predict whether the hole was collected from or not.The U-Net is very deep in order for bottleneck-layer convolutional activations to have large squares fit entirely within the receptive field of the neuron -this means that for grids with smaller holes, the U-Net will have substantial information about the location of the hole on the grid and the characteristics of nearby holes that our classifiers, which use only hole crops, cannot have.

Discussion

21Increasing throughput and reducing cost through automation is required to meet increasing demand for cryo-EM.In this work, we present Ptolemy, an open-source package for automatic targeting and classification of cryo-EM lowand medium-mag images using purpose-designed computer vision and deep learning algorithms.Ptolemy localizes and ranks squares and holes in low-and medium-mag images across a wide range of image and sample conditions.By training on large datasets of microscope operator selection locations, Ptolemy's localization algorithms generalize to diverse gold and carbon holey grids and rank potential collection locations well without session-specific parameters, as we have demonstrated on held-out collection sessions within the NYSBC dataset and an independent dataset from another facility.

22One of the major challenges in developing Ptolemy is the lack of fully annotated data for training and assessment of model performance.We rely on operator selections which are incomplete expert human selections.This incomplete ground truth causes our reported performance to underestimate the true performance of the models.Furthermore, operator selections only represent an expert guess of the best collection locations which we use as ground-truth labels.Thus, our models are trained to recapitulate operator selection decisions as a surrogate for selecting high-quality data.Ideally, we would train and evaluate our models based on the true end goal of cryo-EM data collection, particle quantity and resulting structure quality.

23Optimal collection locations also vary by particle and sample preparation conditions, but Ptolemy is agnostic to these parameters. 8For each session prior to data collection, operators usually screen several holes with varying characteristics to learn which squares are likely to contain good particles.In the future, we plan to use the current Ptolemy classification models as prior models, and to dynamically update these prior models during each collection session based on the quality of highest-mag exposures that are collected from explored squares and holes.This highlights one benefit of the dedicated CNN hole classifier over the scores given by the localization U-Net, because the CNN can be used as a pre-trained hole featurization model.We expect such an active-learning model to further increase data collection efficiency by learning the unique characteristics of each session automatically.

24Ptolemy is a significant advance in the automation of cryo-EM data collection, allowing for fully unattended data collection which increases microscope and operator efficiency.Ptolemy is the first method for automatic targeting of both low-and medium-mag cryo-EM images.Moreover, we have shown that the included methods and models generalize to both carbon and gold holey grids, and to new sessions from different microscopes.This generalization is enabled by our novel square and hole localization algorithms which exploit structure in low-and medium-mag images.To accelerate cryo-EM collection for the whole community, we make Ptolemy freely available for academic use and open-source at (https://github.com/SMLC-NYSBC/ptolemy).We anticipate that this work will prove useful both as a current tool for increasing efficiency of cryo-EM data collection, and as the basis for future work in automation of cryo-EM.

Figure 1 .

25Figure 1.Pipeline overview.High-mag images are taken from ROIs in med-mag images, which come from ROIs in low-mag images.A. Ptolemy detects, crops, then classifies squares in low-mag images.B. Next, Ptolemy detects, crops, then classifies holes in newly-collected med-mag images.

Figure 2 .

26Figure 2. Example of the square localization procedure.A. Original input image.B. Mask recovered after segmenting pixels.C. Finding convex polygons around the separate regions in the mask.D. Aligned minimum bounding rectangles around the polygons, used for crops of the images.

Figure 3 .

27Figure 3. Example medium-mag image Selection locations are marked in yellow.The input to the U-Net is the image without any marking for the selection locations, while the output is a map with a 1 at each pixel where a selection occurred and 0 elsewhere.

2

28where is the output of the U-Net, N is the number of pixels in the image, is the lattice generated by anchor , points and , and and allow us to independently weight the cost for false positives and false negatives.Candidate anchor point pairs are found by finding centroids of high probability regions in the U-output map, and for each centroid, pairing with the K closest other centroids.K trades performance for runtime -here we used K=6.

Figure 4 .

29Figure 4. Example hole-center detection without lattice fitting.A. Input image.B. U-Net output.C. Centroids from high-probability regions in U-Net output (red).

Figure 5 .

30Figure 5. Example hole-center detection on a difficult image.On this low contrast image, lattice fitting extends to missed holes while cleaning erroneous detections. A. Input image B. U-Net output C. Centroids from high-probability regions in U-Net output (red).Many locations outside holes are detected incorrectly, and one hole (orange) is missed.D. Running the optimal-lattice-finding algorithm results in finding lattice anchor points (cyan).E. The lattice generated by these anchor points (cyan) results in coverage of all holes and cleans the incorrect detections.

Table 1 . 301 Figure 6 .

31Figure 6.Example square localizations on low-mag images.

Figure 7 .

32Figure 7. Feature importances for square classification.Results from obtaining feature importances of square image summary statistics for predicting whether or not a square is selected using a random forest model.

Figure 8 .

33Figure 8. Example square classifications in low-mag images.Model predicted probabilities for squares in red.Colors from high to low score: dark blue, light blue, white, yellow, orange, red.

Figure 9 .

34Figure 9. Examples of hole localization using the U-Net + Lattice Fitting.The model successfully detects all holes across a wide range of hole sizes, brightness, and contrast conditions, from easily visible gold grids (top right) to very low contrast carbon grids that are difficult to see even for humans (bottom left).

Figure 10 .

35Figure 10.Sigma parameter versus model training progress.We plot the Gaussian smoothing sigma parameter against average precision on validation set during training of U-Net.

Figure 11 .

36Figure 11.Example hole classifications in medium-mag images.Model predicted probabilities for holes in red.Colors from high to low score: dark blue, light blue, white, yellow, orange, red.

Table 2 .

37Performance metrics of different ML models on held-out-sessions.

Table 3 .

38Performance metrics of different methods on held-out sessions for hole localization from medium-mag images.Reported metrics are aggregated by session and averaged.

Table 4 .

39Performance of hole classification CNNs on hold-out sessions.

참고문헌 26건

  1. A gaussian-mixture-based image segmentation algorithm Pattern Recognition · Elsevier BV · 1998 10.1016/s0031-3203(97)00045-9
  2. A Primer to Single-Particle Cryo-Electron Microscopy Cell · Cell Press · 2015 10.1016/j.cell.2015.03.050
  3. How cryo-EM is revolutionizing structural biology Trends in Biochemical Sciences · Elsevier BV · 2014 10.1016/j.tibs.2014.10.005
  4. Automated molecular microscopy: The new Leginon system Journal of Structural Biology · Elsevier BV · 2005 10.1016/j.jsb.2005.03.010
  5. Leginon: An Automated System for Acquisition of Images from Vitreous Ice Specimens Journal of Structural Biology · Elsevier BV · 2000 10.1006/jsbi.2000.4314
  6. Automated electron microscope tomography using robust prediction of specimen movements Journal of Structural Biology · Elsevier BV · 2005 10.1016/j.jsb.2005.07.007
  7. The Current Revolution in Cryo-EM Biophysical Journal · Elsevier BV · 2016 10.1016/j.bpj.2016.02.001
  8. cryoSPARC: algorithms for rapid unsupervised cryo-EM structure determination Nature Methods · Nature Portfolio · 2017 10.1038/nmeth.4169
  9. Challenges and opportunities in cryo-EM single-particle analysis Journal of Biological Chemistry · Elsevier BV · 2019 10.1074/jbc.rev118.005602
  10. Deep learning Nature · Nature Portfolio · 2015 10.1038/nature14539
  11. Routine single particle CryoEM sample and grid characterization by tomography eLife · eLife Sciences Publications Ltd · 2018 10.7554/elife.34257
  12. SPHIRE-crYOLO is a fast and accurate fully automated particle picker for cryo-EM Communications Biology · Nature Portfolio · 2019 10.1038/s42003-019-0437-z
  13. A survey on Image Data Augmentation for Deep Learning Journal Of Big Data · Springer Science+Business Media · 2019 10.1186/s40537-019-0197-0
  14. Real-time cryo-electron microscopy data preprocessing with Warp Nature Methods · Nature Portfolio · 2019 10.1038/s41592-019-0580-y
  15. Development of a deep learning-based method to identify “good” regions of a cryo-electron microscopy grid Biophysical Reviews · Springer International Publishing · 2020 10.1007/s12551-020-00669-6
  16. High-Throughput Cryo-EM Enabled by User-Free Preprocessing Routines Structure · Elsevier BV · 2020 10.1016/j.str.2020.03.008
  17. MicrographCleaner: A python package for cryo-EM micrograph cleaning using deep learning Journal of Structural Biology · Elsevier BV · 2020 10.1016/j.jsb.2020.107498
  18. Present and Emerging Methodologies in Cryo-EM Single-Particle Analysis Biophysical Journal · Elsevier BV · 2020 10.1016/j.bpj.2020.08.027
  19. Positive-unlabeled convolutional neural networks for particle picking in cryo-electron micrographs Nature Methods · Nature Portfolio · 2019 10.1038/s41592-019-0575-8
  20. CryoDRGN: reconstruction of heterogeneous cryo-EM structures using neural networks Nature Methods · Nature Portfolio · 2021 10.1038/s41592-020-01049-4
  21. CASSPER is a semantic segmentation-based particle picking algorithm for single-particle cryo-electron microscopy Communications Biology · Nature Portfolio · 2021 10.1038/s42003-021-01721-1
  22. Understanding the invisible hands of sample preparation for cryo-EM Nature Methods · Nature Portfolio · 2021 10.1038/s41592-021-01130-6
  23. Better, Faster, Cheaper: Recent Advances in Cryo–Electron Microscopy Annual Review of Biochemistry · Annual Reviews · 2022 10.1146/annurev-biochem-032620-110705
  24. TRPV1 and Piezo: the 2021 Nobel Prize in Physiology or Medicine IUCrJ · International Union of Crystallography · 2021 10.1107/s2052252521013488
  25. Automated systematic evaluation of cryo-EM specimens with SmartScope eLife · eLife Sciences Publications Ltd · 2022 10.7554/elife.80047
  26. Fully automated multi-grid cryoEM screening using <i>Smart Leginon</i> IUCrJ · International Union of Crystallography · 2022 10.1107/s2052252522010624