Advances in uorescence microscopy enable monitoring larger brain areas in-vivo with 13 ner time resolution. The resulting data rates require reproducible analysis pipelines that are 14 reliable, fully automated, and scalable to datasets generated over the course of months. Here we 15 present CAIMAN, an open-source library for calcium imaging data analysis. CAIMAN provides 16 automatic and scalable methods to address problems common to pre-processing, including motion 17 correction, neural activity identi cation, and registration across di erent sessions of data collection. 18 It does this while requiring minimal user intervention, with good performance on computers 19 ranging from laptops to high-performance computing clusters. CAIMAN is suitable for two-photon 20 and one-photon imaging, and also enables real-time analysis on streaming data. To benchmark the 21 performance of CAIMAN we collected a corpus of ground truth annotations from multiple labelers 22 on nine mouse two-photon datasets. We demonstrate that CAIMAN achieves near-human 23 performance in detecting locations of active neurons. 24 25 30 di erent brain areas over extended periods of time (weeks or months). Advances in microscopy 31 techniques facilitate imaging larger brain areas with ner time resolution, producing an ever-32 increasing amount of data. A typical resonant scanning two-photon microscope produces data at a 33 rate greater than 50GB/Hour 1 , a number that can be signi cantly higher (up to more than 1TB/Hour) 34 with other custom recording technologies (Sofroniew et al. (2016); Ahrens et al. (2013); Flusberg 35 et al. (2008); Cai et al. (2016); Prevedel et al. (2014); Grosenick et al. (2017); Bouchard et al. (2015)). 36 This increasing availability and volume of calcium imaging data calls for automated analysis 37 methods and reproducible pipelines to extract the relevant information from the recorded movies, 38 i.e., the locations of neurons in the imaged Field of View (FOV) and their activity in terms of raw 39 1 Calculation performed on a 512Ăč512 FOV imaged at 30Hz producing an unsigned 16-bit integer for each measurement. 1 of 40 Manuscript submitted uorescence and/or neural activity (spikes). The typical steps arising in the processing pipelines are 40 the following (Fig. 1a): i) Motion correction, where the FOV at each data frame (image or volume) 41 is registered against a template to correct for motion artifacts due to the nite scanning rate and 42 existing brain motion, ii) source extraction where the di erent active and possibly overlapping 43 sources are extracted and their signals are demixed from each other and from the background 44 neuropil signals (Fig. 1b), and iii) activity deconvolution, where the neural activity of each identi ed 45 source is deconvolved from the dynamics of the calcium indicator. 46 Related work 47 Source extraction 48 Some source extraction methods attempt the detection of neurons in static images using supervised 49 or unsupervised learning methods. Examples of unsupervised methods on sum...