Skip to main content
QUICK REVIEW

[Paper Review] Flexible and Scalable Deep Learning with MMLSpark

Mark Hamilton, Sudarshan Raghunathan|arXiv (Cornell University)|Apr 11, 2018
Advanced Image and Video Retrieval TechniquesComputer Science11 references4 citations
TL;DR

This paper presents MMLSpark, an open-source library that integrates Microsoft's Cognitive Toolkit (CNTK) with Apache Spark to enable scalable, distributed deep learning. By extending Spark with CNTK's deep learning capabilities, OpenCV for image processing, and automatic PySpark/SparklyR wrappers, the framework achieves state-of-the-art performance in classifying snow leopard images from camera traps, significantly outperforming traditional methods through model ensembling, data augmentation, and burst-based video classification.

ABSTRACT

In this work we detail a novel open source library, called MMLSpark, that combines the flexible deep learning library Cognitive Toolkit, with the distributed computing framework Apache Spark. To achieve this, we have contributed Java Language bindings to the Cognitive Toolkit, and added several new components to the Spark ecosystem. In addition, we also integrate the popular image processing library OpenCV with Spark, and present a tool for the automated generation of PySpark wrappers from any SparkML estimator and use this tool to expose all work to the PySpark ecosystem. Finally, we provide a large library of tools for working and developing within the Spark ecosystem. We apply this work to the automated classification of Snow Leopards from camera trap images, and provide an end to end solution for the non-profit conservation organization, the Snow Leopard Trust.

Motivation & Objective

  • Address the lack of deep learning support in Apache Spark’s ML ecosystem, particularly for GPU-accelerated, differentiable neural networks.
  • Enable seamless integration of deep learning models into the Spark ecosystem for distributed training and inference at scale.
  • Provide end-to-end support for image processing pipelines by integrating OpenCV with Spark and enabling automatic PySpark wrapper generation.
  • Develop a scalable, fault-tolerant deep learning pipeline for real-world conservation applications, demonstrated on snow leopard identification.
  • Improve model accuracy and training efficiency through data augmentation, model ensembling, and burst-based video classification techniques.

Proposed method

  • Developed Java language bindings for the Microsoft Cognitive Toolkit (CNTK) to enable integration with Spark’s JVM-based execution model.
  • Extended Spark with new components to support distributed deep learning inference and training using CNTK’s symbolic computation graphs.
  • Integrated OpenCV into Spark to enable scalable image preprocessing and transformation pipelines.
  • Built an automated tool to generate PySpark wrappers from any SparkML estimator, enabling full interoperability with Python and R ecosystems.
  • Implemented a multi-stage deep learning pipeline: feature extraction with ResNet50, fine-tuning with a logistic regressor, data augmentation via horizontal flipping, and burst-level ensembling using temporally grouped images.
  • Leveraged Spark’s key-based grouping to identify and process camera trap image bursts, averaging predictions across frames to reduce variance and improve accuracy.

Experimental results

Research questions

  • RQ1Can deep learning models be efficiently and flexibly integrated into the Apache Spark ecosystem to enable distributed training and inference?
  • RQ2How can the performance and scalability of deep learning in Spark be enhanced through integration with high-performance frameworks like CNTK and OpenCV?
  • RQ3To what extent can data augmentation and temporal ensembling improve the accuracy of wildlife image classification in low-data regimes?
  • RQ4Can automated PySpark wrapper generation effectively bridge the gap between SparkML and deep learning frameworks?
  • RQ5How does the integration of CNTK with Spark compare to existing deep learning solutions in terms of scalability and fault tolerance?

Key findings

  • The MMLSpark framework successfully enables distributed deep learning on Spark by integrating CNTK, OpenCV, and PySpark/SparklyR, achieving seamless interoperability across multiple programming languages.
  • The proposed pipeline achieved significantly higher accuracy than traditional machine learning methods, with the best model (RN2+A+E) outperforming logistic regression on raw pixels (LR120) as shown in ROC and confusion matrix comparisons.
  • Data augmentation via horizontal flipping (ImageSetAugmenter) doubled the effective training set size and improved model generalization, reducing variance in predictions.
  • Sequence ensembling over temporally grouped camera trap image bursts reduced false negatives and improved overall classification accuracy by leveraging label consistency across frames.
  • The framework demonstrated strong scalability and fault tolerance, enabling large-scale, production-grade deep learning workflows on Spark clusters.
  • The integration of CNTK with Spark via Java bindings and automated PySpark wrappers enables full support for both training and inference in distributed environments, with potential for future extensions like SymSGD for improved communication efficiency.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.