SlideShare uma empresa Scribd logo
1 de 24
Baixar para ler offline
Real-time personal trainer on
the SMACK stack



@honzam399 Jan Machacek 

@anirvan_c Anirvan Chakraborty 

© 2016 Cake Solutions Limited CC BY-NC-SA 4.0
Automated personal trainer - muvr
• Suggests the sequence of exercise sessions
• Suggests exercises in a session, including exercise
parameters (e.g. weight, repetitions, …)
• Provides tips on proper exercise form
• With additional hardware (smartwatch, smart clothes),
muvr provides
• Completely unobtrusive exercise experience
• More accurate tips on proper exercise form
• With over–fitting, it is usable for physiotherapy
© 2016 Cake Solutions Limited CC BY-NC-SA 4.0
Architecture
© 2016 Cake Solutions Limited CC BY-NC-SA 4.0
Privacy
© 2016 Cake Solutions Limited CC BY-NC-SA 4.0
The technologies—iOS
• Learns the users’ behaviour
• Exercise sessions
• Exercises within exercise session
• Short–term prediction of [scalar] labels for the exercises
• Performs the real–time analysis of the incoming sensor
data
• Advised by the expected behaviour
• Signal processing to compute repetitions / strokes
• Forward–propagation to label the exercise
• Submits all recorded sensor data and confirmed (!) labels
per session
• Handles offline / travel modes
• Synchronises the data across the user’s devices using iCloud
© 2016 Cake Solutions Limited CC BY-NC-SA 4.0
The technologies—Akka
• Reactive services for user profiles, model parameters,
and sensor data
• CQRS/ES implementation, which helps to
• Handle peaks in load
• Handle failures of individual nodes
• Reason about the scope of the mutable state we keep
• Uses Cassandra for its journal and snapshot stores
• The written values are binary “blobs”
• Writes the sensor data to Cassandra
• Writes the sensor data in “readable” form; it can be read outside the Akka / Scala
world
• Reads the model and exercise parameters from
Cassandra
• It selects the best / newest model parameters to serve to the mobile app
© 2016 Cake Solutions Limited CC BY-NC-SA 4.0
The technologies—Spark
• Distributed computation framework
• “Big data” tasks
• Integrates extremely well with Cassandra
• Reads and processes the profiles and sensor data
• Identifies clusters of users on their profile information
• Slices the sensor inputs by sensor types
• Writes the results to another store
• Runs in batches
• Executes by schedule (typically once a day)
© 2016 Cake Solutions Limited CC BY-NC-SA 4.0
The technologies—neon
• A machine learning framework, including
• “The usual” suspects in tensor algebra
• Signal processing
• Different ML approaches
• Training and evaluation programs
• Both programs terminate either upon discovering the perfect model or when their
budget is up
• Reads clustered training and testing data from the Spark job
• Writes the model parameters and evaluation result to Cassandra
© 2016 Cake Solutions Limited CC BY-NC-SA 4.0
The technologies—Cassandra
• Underpins the entire platform
• Journal and snapshot store for Akka
• Sensor data store
• Model parameter store
• “Summary” store
• High availability
• No single point of failure
• High read and write
• Replication factor
• Tuneable consistency level
© 2016 Cake Solutions Limited CC BY-NC-SA 4.0
© 2016 Cake Solutions Limited CC BY-NC-SA 4.0
Spark & Cassandra
• Group the sensor data into n clusters by user profile with
biometric ID
• Expand the sensor data
• Slices of the sensor data by combinations of accelerometer, gyroscope, heart rate,
targeted muscle group strain gauges, …
• 1 user = 1 MiB from one sensor per hour; but 4 sensors expand into 4! MiB
• Trivial tasks
• The most popular user–contributed exercises
• The most popular exercise sessions and exercises within the sessions
• The most effective (by overall fitness improvement, weight loss, muscle mass gain, …)
exercise sessions
© 2016 Cake Solutions Limited CC BY-NC-SA 4.0
Production ML
Take the data from Cassandra (written there by the Spark
jobs) and:
• Split into training and test datasets
• Fit models for various sensor types
• Save model parameters
• Evaluate the newly fitted models, and re-evaluate old
data
© 2016 Cake Solutions Limited CC BY-NC-SA 4.0
Production ML
• We are using convolutional network
• 2 seconds of sensor data input (e.g. a @ 50 Hz for accelerometer; a, g @ 50 Hz for
accelerometer + gyroscope; u, l @ 10 Hz for smart clothes)
• The exercise classes as the outputs
• The training program
• CNN in neon
• Loads the mini–batches from Cassandra
• Fits the model; evaluates the fitted model
• Saves the model parameters into Cassandra
• The re–evaluation program
• Re–evaluates past n models against the latest training dataset; computing accuracy,
precision, recall, f1
© 2016 Cake Solutions Limited CC BY-NC-SA 4.0
Having code is jolly good
© 2016 Cake Solutions Limited CC BY-NC-SA 4.0
Running it
• Simplicity
• Ease of orchestration
• Ease of development
• Support for polyglot frameworks and components
• Cost effective resource utilisation
© 2016 Cake Solutions Limited CC BY-NC-SA 4.0
Docker
• Deploy reliably & consistently
• Execution is fast and light weight
• Simplicity
• Developer friendly workflow
• Fantastic community
© 2016 Cake Solutions Limited CC BY-NC-SA 4.0
Dockerize Cassandra Dev Environment
• Super low memory settings in cassandra-env.sh
• MAX_HEAP_SIZE=“128M”
• HEAP_NEWSIZE=“24M”
• Remove caches in dev mode in cassandra.yml
• key_cache_size_in_mb: 0
• reduce_cache_sizes_at: 0
• reduce_cache_capacity_to: 0
© 2016 Cake Solutions Limited CC BY-NC-SA 4.0
Dockerize Cassandra Production
• Use host networking (—net=host) for better network
performance
• Put data, commitlog and saved_caches in volume
mount folders to the underlying host
• Run cassandra on the foreground using (-f)
• Tune JVM heap for optimal size
• Tune JVM garbage collector for your workload
© 2016 Cake Solutions Limited CC BY-NC-SA 4.0
Mesos
• Distributed systems kernel
• Scales to 10,000s of nodes
• Depends on Zookeeper for fault tolerance and high
availability
• Creates a highly available, scalable single resource pool
• Automatic failover
• Ease of management
• Simple to operate
• Support for Docker container
© 2016 Cake Solutions Limited CC BY-NC-SA 4.0
Mesos architecture
image source: https://assets.digitalocean.com/articles/mesosphere/mesos_architecture.png
© 2016 Cake Solutions Limited CC BY-NC-SA 4.0
Cassandra on Mesos
• Running Cassandra as Docker containers
• Custom Dockerfile and entry-point script to control Cassandra configuration
• Marathon to initialize and control
© 2016 Cake Solutions Limited CC BY-NC-SA 4.0
Cost effective resource in AWS
• Embrace AWS spot instances
• About 50-60% cheaper than on demand instances
• Can be reclaimed without notice if outbidded
• Run dev and staging on spot instances
• Run Spark jobs on spot instances
© 2016 Cake Solutions Limited CC BY-NC-SA 4.0
© 2016 Cake Solutions Limited CC BY-NC-SA 4.0
Thanks!
Twitter: @cakesolutions

Tel: 0845 617 1200
Email: enquiries@cakesolutions.net
Jobs: http://www.cakesolutions.net/
careers

Mais conteúdo relacionado

Mais procurados

Kafka Lambda architecture with mirroring
Kafka Lambda architecture with mirroringKafka Lambda architecture with mirroring
Kafka Lambda architecture with mirroring
Anant Rustagi
 

Mais procurados (20)

SMACK Stack - Fast Data Done Right by Stefan Siprell at Codemotion Dubai
SMACK Stack - Fast Data Done Right by Stefan Siprell at Codemotion DubaiSMACK Stack - Fast Data Done Right by Stefan Siprell at Codemotion Dubai
SMACK Stack - Fast Data Done Right by Stefan Siprell at Codemotion Dubai
 
How to deploy Apache Spark 
to Mesos/DCOS
How to deploy Apache Spark 
to Mesos/DCOSHow to deploy Apache Spark 
to Mesos/DCOS
How to deploy Apache Spark 
to Mesos/DCOS
 
Big Data visualization with Apache Spark and Zeppelin
Big Data visualization with Apache Spark and ZeppelinBig Data visualization with Apache Spark and Zeppelin
Big Data visualization with Apache Spark and Zeppelin
 
Using Spark, Kafka, Cassandra and Akka on Mesos for Real-Time Personalization
Using Spark, Kafka, Cassandra and Akka on Mesos for Real-Time PersonalizationUsing Spark, Kafka, Cassandra and Akka on Mesos for Real-Time Personalization
Using Spark, Kafka, Cassandra and Akka on Mesos for Real-Time Personalization
 
Fast and Simplified Streaming, Ad-Hoc and Batch Analytics with FiloDB and Spa...
Fast and Simplified Streaming, Ad-Hoc and Batch Analytics with FiloDB and Spa...Fast and Simplified Streaming, Ad-Hoc and Batch Analytics with FiloDB and Spa...
Fast and Simplified Streaming, Ad-Hoc and Batch Analytics with FiloDB and Spa...
 
Kafka Lambda architecture with mirroring
Kafka Lambda architecture with mirroringKafka Lambda architecture with mirroring
Kafka Lambda architecture with mirroring
 
Near Real Time Indexing Kafka Messages into Apache Blur: Presented by Dibyend...
Near Real Time Indexing Kafka Messages into Apache Blur: Presented by Dibyend...Near Real Time Indexing Kafka Messages into Apache Blur: Presented by Dibyend...
Near Real Time Indexing Kafka Messages into Apache Blur: Presented by Dibyend...
 
Lambda architecture
Lambda architectureLambda architecture
Lambda architecture
 
Alpine academy apache spark series #1 introduction to cluster computing wit...
Alpine academy apache spark series #1   introduction to cluster computing wit...Alpine academy apache spark series #1   introduction to cluster computing wit...
Alpine academy apache spark series #1 introduction to cluster computing wit...
 
Spark Kernel Talk - Apache Spark Meetup San Francisco (July 2015)
Spark Kernel Talk - Apache Spark Meetup San Francisco (July 2015)Spark Kernel Talk - Apache Spark Meetup San Francisco (July 2015)
Spark Kernel Talk - Apache Spark Meetup San Francisco (July 2015)
 
Typesafe & William Hill: Cassandra, Spark, and Kafka - The New Streaming Data...
Typesafe & William Hill: Cassandra, Spark, and Kafka - The New Streaming Data...Typesafe & William Hill: Cassandra, Spark, and Kafka - The New Streaming Data...
Typesafe & William Hill: Cassandra, Spark, and Kafka - The New Streaming Data...
 
Reactive dashboard’s using apache spark
Reactive dashboard’s using apache sparkReactive dashboard’s using apache spark
Reactive dashboard’s using apache spark
 
Real Time Data Processing Using Spark Streaming
Real Time Data Processing Using Spark StreamingReal Time Data Processing Using Spark Streaming
Real Time Data Processing Using Spark Streaming
 
Streaming Analytics with Spark, Kafka, Cassandra and Akka
Streaming Analytics with Spark, Kafka, Cassandra and AkkaStreaming Analytics with Spark, Kafka, Cassandra and Akka
Streaming Analytics with Spark, Kafka, Cassandra and Akka
 
Delivering Meaning In Near-Real Time At High Velocity In Massive Scale with A...
Delivering Meaning In Near-Real Time At High Velocity In Massive Scale with A...Delivering Meaning In Near-Real Time At High Velocity In Massive Scale with A...
Delivering Meaning In Near-Real Time At High Velocity In Massive Scale with A...
 
An Introduction to Distributed Search with Datastax Enterprise Search
An Introduction to Distributed Search with Datastax Enterprise SearchAn Introduction to Distributed Search with Datastax Enterprise Search
An Introduction to Distributed Search with Datastax Enterprise Search
 
Using the SDACK Architecture to Build a Big Data Product
Using the SDACK Architecture to Build a Big Data ProductUsing the SDACK Architecture to Build a Big Data Product
Using the SDACK Architecture to Build a Big Data Product
 
Spark and Spark Streaming at Netfix-(Kedar Sedekar and Monal Daxini, Netflix)
Spark and Spark Streaming at Netfix-(Kedar Sedekar and Monal Daxini, Netflix)Spark and Spark Streaming at Netfix-(Kedar Sedekar and Monal Daxini, Netflix)
Spark and Spark Streaming at Netfix-(Kedar Sedekar and Monal Daxini, Netflix)
 
Recipes for Running Spark Streaming Applications in Production-(Tathagata Das...
Recipes for Running Spark Streaming Applications in Production-(Tathagata Das...Recipes for Running Spark Streaming Applications in Production-(Tathagata Das...
Recipes for Running Spark Streaming Applications in Production-(Tathagata Das...
 
Feeding Cassandra with Spark-Streaming and Kafka
Feeding Cassandra with Spark-Streaming and KafkaFeeding Cassandra with Spark-Streaming and Kafka
Feeding Cassandra with Spark-Streaming and Kafka
 

Destaque

Salesforce API Series: Fast Parallel Data Loading with the Bulk API Webinar
Salesforce API Series: Fast Parallel Data Loading with the Bulk API WebinarSalesforce API Series: Fast Parallel Data Loading with the Bulk API Webinar
Salesforce API Series: Fast Parallel Data Loading with the Bulk API Webinar
Salesforce Developers
 

Destaque (20)

Machine Learning Pipelines
Machine Learning PipelinesMachine Learning Pipelines
Machine Learning Pipelines
 
Demystifying salesforce for developers
Demystifying salesforce for developersDemystifying salesforce for developers
Demystifying salesforce for developers
 
Extreme Salesforce Data Volumes Webinar
Extreme Salesforce Data Volumes WebinarExtreme Salesforce Data Volumes Webinar
Extreme Salesforce Data Volumes Webinar
 
How Apache Kafka is transforming Hadoop, Spark and Storm
How Apache Kafka is transforming Hadoop, Spark and StormHow Apache Kafka is transforming Hadoop, Spark and Storm
How Apache Kafka is transforming Hadoop, Spark and Storm
 
Large volume data analysis on the Typesafe Reactive Platform - Big Data Scala...
Large volume data analysis on the Typesafe Reactive Platform - Big Data Scala...Large volume data analysis on the Typesafe Reactive Platform - Big Data Scala...
Large volume data analysis on the Typesafe Reactive Platform - Big Data Scala...
 
Handling of Large Data by Salesforce
Handling of Large Data by SalesforceHandling of Large Data by Salesforce
Handling of Large Data by Salesforce
 
Big Data Day LA 2015 - Event Driven Architecture for Web Analytics by Peyman ...
Big Data Day LA 2015 - Event Driven Architecture for Web Analytics by Peyman ...Big Data Day LA 2015 - Event Driven Architecture for Web Analytics by Peyman ...
Big Data Day LA 2015 - Event Driven Architecture for Web Analytics by Peyman ...
 
Case Study: Elasticsearch Ingest Using StreamSets @ Cisco Intercloud
Case Study: Elasticsearch Ingest Using StreamSets @ Cisco IntercloudCase Study: Elasticsearch Ingest Using StreamSets @ Cisco Intercloud
Case Study: Elasticsearch Ingest Using StreamSets @ Cisco Intercloud
 
Machine learning at Scale with Apache Spark
Machine learning at Scale with Apache SparkMachine learning at Scale with Apache Spark
Machine learning at Scale with Apache Spark
 
Salesforce REST API
Salesforce  REST API Salesforce  REST API
Salesforce REST API
 
Understanding the Salesforce Architecture: How We Do the Magic We Do
Understanding the Salesforce Architecture: How We Do the Magic We DoUnderstanding the Salesforce Architecture: How We Do the Magic We Do
Understanding the Salesforce Architecture: How We Do the Magic We Do
 
Salesforce API Series: Fast Parallel Data Loading with the Bulk API Webinar
Salesforce API Series: Fast Parallel Data Loading with the Bulk API WebinarSalesforce API Series: Fast Parallel Data Loading with the Bulk API Webinar
Salesforce API Series: Fast Parallel Data Loading with the Bulk API Webinar
 
Big Data Architectural Patterns and Best Practices on AWS
Big Data Architectural Patterns and Best Practices on AWSBig Data Architectural Patterns and Best Practices on AWS
Big Data Architectural Patterns and Best Practices on AWS
 
Introduction to Apache NiFi - Seattle Scalability Meetup
Introduction to Apache NiFi - Seattle Scalability MeetupIntroduction to Apache NiFi - Seattle Scalability Meetup
Introduction to Apache NiFi - Seattle Scalability Meetup
 
Microservice-based Architecture on the Salesforce App Cloud
Microservice-based Architecture on the Salesforce App CloudMicroservice-based Architecture on the Salesforce App Cloud
Microservice-based Architecture on the Salesforce App Cloud
 
Large Data Management Strategies
Large Data Management StrategiesLarge Data Management Strategies
Large Data Management Strategies
 
Kafka at Scale: Multi-Tier Architectures
Kafka at Scale: Multi-Tier ArchitecturesKafka at Scale: Multi-Tier Architectures
Kafka at Scale: Multi-Tier Architectures
 
Reference architecture for Internet of Things
Reference architecture for Internet of ThingsReference architecture for Internet of Things
Reference architecture for Internet of Things
 
Big Data Architectural Patterns
Big Data Architectural PatternsBig Data Architectural Patterns
Big Data Architectural Patterns
 
Secure Kafka at Salesforce.com
Secure Kafka at Salesforce.comSecure Kafka at Salesforce.com
Secure Kafka at Salesforce.com
 

Semelhante a Real-time personal trainer on the SMACK stack

2 Day Bootcamp for OpenStack--Cloud Training by Mirantis (Preview)
2 Day Bootcamp for OpenStack--Cloud Training by Mirantis (Preview)2 Day Bootcamp for OpenStack--Cloud Training by Mirantis (Preview)
2 Day Bootcamp for OpenStack--Cloud Training by Mirantis (Preview)
Mirantis
 

Semelhante a Real-time personal trainer on the SMACK stack (20)

Building production spark streaming applications
Building production spark streaming applicationsBuilding production spark streaming applications
Building production spark streaming applications
 
MySQL Day Paris 2016 - Introducing Oracle MySQL Cloud Service
MySQL Day Paris 2016 - Introducing Oracle MySQL Cloud ServiceMySQL Day Paris 2016 - Introducing Oracle MySQL Cloud Service
MySQL Day Paris 2016 - Introducing Oracle MySQL Cloud Service
 
OpenStack Enabling DevOps
OpenStack Enabling DevOpsOpenStack Enabling DevOps
OpenStack Enabling DevOps
 
Typesafe spark- Zalando meetup
Typesafe spark- Zalando meetupTypesafe spark- Zalando meetup
Typesafe spark- Zalando meetup
 
mParticle's Journey to Scylla from Cassandra
mParticle's Journey to Scylla from CassandramParticle's Journey to Scylla from Cassandra
mParticle's Journey to Scylla from Cassandra
 
HPC and cloud distributed computing, as a journey
HPC and cloud distributed computing, as a journeyHPC and cloud distributed computing, as a journey
HPC and cloud distributed computing, as a journey
 
Big data architecture on cloud computing infrastructure
Big data architecture on cloud computing infrastructureBig data architecture on cloud computing infrastructure
Big data architecture on cloud computing infrastructure
 
Microservices deck
Microservices deckMicroservices deck
Microservices deck
 
Forecasting Kafka Lag Issues with Machine Learning
Forecasting Kafka Lag Issues with Machine LearningForecasting Kafka Lag Issues with Machine Learning
Forecasting Kafka Lag Issues with Machine Learning
 
Configuration Management in the Cloud | AWS Public Sector Summit 2017
Configuration Management in the Cloud | AWS Public Sector Summit 2017Configuration Management in the Cloud | AWS Public Sector Summit 2017
Configuration Management in the Cloud | AWS Public Sector Summit 2017
 
Webinar: DataStax Training - Everything you need to become a Cassandra Rockstar
Webinar: DataStax Training - Everything you need to become a Cassandra RockstarWebinar: DataStax Training - Everything you need to become a Cassandra Rockstar
Webinar: DataStax Training - Everything you need to become a Cassandra Rockstar
 
Stay productive_while_slicing_up_the_monolith
Stay productive_while_slicing_up_the_monolithStay productive_while_slicing_up_the_monolith
Stay productive_while_slicing_up_the_monolith
 
Cloud Infrastructures Slide Set 8 - More Cloud Technologies - Mesos, Spark | ...
Cloud Infrastructures Slide Set 8 - More Cloud Technologies - Mesos, Spark | ...Cloud Infrastructures Slide Set 8 - More Cloud Technologies - Mesos, Spark | ...
Cloud Infrastructures Slide Set 8 - More Cloud Technologies - Mesos, Spark | ...
 
Cloud nativecomputingtechnologysupportinghpc cognitiveworkflows
Cloud nativecomputingtechnologysupportinghpc cognitiveworkflowsCloud nativecomputingtechnologysupportinghpc cognitiveworkflows
Cloud nativecomputingtechnologysupportinghpc cognitiveworkflows
 
Headaches and Breakthroughs in Building Continuous Applications
Headaches and Breakthroughs in Building Continuous ApplicationsHeadaches and Breakthroughs in Building Continuous Applications
Headaches and Breakthroughs in Building Continuous Applications
 
High Performance Object Pascal Code on Servers (at EKON 22)
High Performance Object Pascal Code on Servers (at EKON 22)High Performance Object Pascal Code on Servers (at EKON 22)
High Performance Object Pascal Code on Servers (at EKON 22)
 
Interop ITX: Moving applications: From Legacy to Cloud-to-Cloud
Interop ITX: Moving applications: From Legacy to Cloud-to-CloudInterop ITX: Moving applications: From Legacy to Cloud-to-Cloud
Interop ITX: Moving applications: From Legacy to Cloud-to-Cloud
 
Spark + AI Summit 2019: Headaches and Breakthroughs in Building Continuous Ap...
Spark + AI Summit 2019: Headaches and Breakthroughs in Building Continuous Ap...Spark + AI Summit 2019: Headaches and Breakthroughs in Building Continuous Ap...
Spark + AI Summit 2019: Headaches and Breakthroughs in Building Continuous Ap...
 
High Performance Computing Pitch Deck
High Performance Computing Pitch DeckHigh Performance Computing Pitch Deck
High Performance Computing Pitch Deck
 
2 Day Bootcamp for OpenStack--Cloud Training by Mirantis (Preview)
2 Day Bootcamp for OpenStack--Cloud Training by Mirantis (Preview)2 Day Bootcamp for OpenStack--Cloud Training by Mirantis (Preview)
2 Day Bootcamp for OpenStack--Cloud Training by Mirantis (Preview)
 

Último

Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service BangaloreCall Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
amitlee9823
 
Abortion pills in Doha Qatar (+966572737505 ! Get Cytotec
Abortion pills in Doha Qatar (+966572737505 ! Get CytotecAbortion pills in Doha Qatar (+966572737505 ! Get Cytotec
Abortion pills in Doha Qatar (+966572737505 ! Get Cytotec
Abortion pills in Riyadh +966572737505 get cytotec
 
➥🔝 7737669865 🔝▻ Mathura Call-girls in Women Seeking Men 🔝Mathura🔝 Escorts...
➥🔝 7737669865 🔝▻ Mathura Call-girls in Women Seeking Men  🔝Mathura🔝   Escorts...➥🔝 7737669865 🔝▻ Mathura Call-girls in Women Seeking Men  🔝Mathura🔝   Escorts...
➥🔝 7737669865 🔝▻ Mathura Call-girls in Women Seeking Men 🔝Mathura🔝 Escorts...
amitlee9823
 
👉 Amritsar Call Girl 👉📞 6367187148 👉📞 Just📲 Call Ruhi Call Girl Phone No Amri...
👉 Amritsar Call Girl 👉📞 6367187148 👉📞 Just📲 Call Ruhi Call Girl Phone No Amri...👉 Amritsar Call Girl 👉📞 6367187148 👉📞 Just📲 Call Ruhi Call Girl Phone No Amri...
👉 Amritsar Call Girl 👉📞 6367187148 👉📞 Just📲 Call Ruhi Call Girl Phone No Amri...
karishmasinghjnh
 
Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
amitlee9823
 
Abortion pills in Jeddah | +966572737505 | Get Cytotec
Abortion pills in Jeddah | +966572737505 | Get CytotecAbortion pills in Jeddah | +966572737505 | Get Cytotec
Abortion pills in Jeddah | +966572737505 | Get Cytotec
Abortion pills in Riyadh +966572737505 get cytotec
 
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
ZurliaSoop
 
Call Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night StandCall Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night Stand
amitlee9823
 
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
amitlee9823
 
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
amitlee9823
 
➥🔝 7737669865 🔝▻ mahisagar Call-girls in Women Seeking Men 🔝mahisagar🔝 Esc...
➥🔝 7737669865 🔝▻ mahisagar Call-girls in Women Seeking Men  🔝mahisagar🔝   Esc...➥🔝 7737669865 🔝▻ mahisagar Call-girls in Women Seeking Men  🔝mahisagar🔝   Esc...
➥🔝 7737669865 🔝▻ mahisagar Call-girls in Women Seeking Men 🔝mahisagar🔝 Esc...
amitlee9823
 

Último (20)

Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service BangaloreCall Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
 
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...
 
Abortion pills in Doha Qatar (+966572737505 ! Get Cytotec
Abortion pills in Doha Qatar (+966572737505 ! Get CytotecAbortion pills in Doha Qatar (+966572737505 ! Get Cytotec
Abortion pills in Doha Qatar (+966572737505 ! Get Cytotec
 
April 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's AnalysisApril 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's Analysis
 
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
 
DATA SUMMIT 24 Building Real-Time Pipelines With FLaNK
DATA SUMMIT 24  Building Real-Time Pipelines With FLaNKDATA SUMMIT 24  Building Real-Time Pipelines With FLaNK
DATA SUMMIT 24 Building Real-Time Pipelines With FLaNK
 
Predicting Loan Approval: A Data Science Project
Predicting Loan Approval: A Data Science ProjectPredicting Loan Approval: A Data Science Project
Predicting Loan Approval: A Data Science Project
 
➥🔝 7737669865 🔝▻ Mathura Call-girls in Women Seeking Men 🔝Mathura🔝 Escorts...
➥🔝 7737669865 🔝▻ Mathura Call-girls in Women Seeking Men  🔝Mathura🔝   Escorts...➥🔝 7737669865 🔝▻ Mathura Call-girls in Women Seeking Men  🔝Mathura🔝   Escorts...
➥🔝 7737669865 🔝▻ Mathura Call-girls in Women Seeking Men 🔝Mathura🔝 Escorts...
 
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...
 
👉 Amritsar Call Girl 👉📞 6367187148 👉📞 Just📲 Call Ruhi Call Girl Phone No Amri...
👉 Amritsar Call Girl 👉📞 6367187148 👉📞 Just📲 Call Ruhi Call Girl Phone No Amri...👉 Amritsar Call Girl 👉📞 6367187148 👉📞 Just📲 Call Ruhi Call Girl Phone No Amri...
👉 Amritsar Call Girl 👉📞 6367187148 👉📞 Just📲 Call Ruhi Call Girl Phone No Amri...
 
Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
 
Abortion pills in Jeddah | +966572737505 | Get Cytotec
Abortion pills in Jeddah | +966572737505 | Get CytotecAbortion pills in Jeddah | +966572737505 | Get Cytotec
Abortion pills in Jeddah | +966572737505 | Get Cytotec
 
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort ServiceBDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
 
Anomaly detection and data imputation within time series
Anomaly detection and data imputation within time seriesAnomaly detection and data imputation within time series
Anomaly detection and data imputation within time series
 
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
Call Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night StandCall Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night Stand
 
Midocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFxMidocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFx
 
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
 
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
 
➥🔝 7737669865 🔝▻ mahisagar Call-girls in Women Seeking Men 🔝mahisagar🔝 Esc...
➥🔝 7737669865 🔝▻ mahisagar Call-girls in Women Seeking Men  🔝mahisagar🔝   Esc...➥🔝 7737669865 🔝▻ mahisagar Call-girls in Women Seeking Men  🔝mahisagar🔝   Esc...
➥🔝 7737669865 🔝▻ mahisagar Call-girls in Women Seeking Men 🔝mahisagar🔝 Esc...
 

Real-time personal trainer on the SMACK stack

  • 1. Real-time personal trainer on the SMACK stack
 
 @honzam399 Jan Machacek 
 @anirvan_c Anirvan Chakraborty 

  • 2. © 2016 Cake Solutions Limited CC BY-NC-SA 4.0 Automated personal trainer - muvr • Suggests the sequence of exercise sessions • Suggests exercises in a session, including exercise parameters (e.g. weight, repetitions, …) • Provides tips on proper exercise form • With additional hardware (smartwatch, smart clothes), muvr provides • Completely unobtrusive exercise experience • More accurate tips on proper exercise form • With over–fitting, it is usable for physiotherapy
  • 3. © 2016 Cake Solutions Limited CC BY-NC-SA 4.0 Architecture
  • 4. © 2016 Cake Solutions Limited CC BY-NC-SA 4.0 Privacy
  • 5. © 2016 Cake Solutions Limited CC BY-NC-SA 4.0 The technologies—iOS • Learns the users’ behaviour • Exercise sessions • Exercises within exercise session • Short–term prediction of [scalar] labels for the exercises • Performs the real–time analysis of the incoming sensor data • Advised by the expected behaviour • Signal processing to compute repetitions / strokes • Forward–propagation to label the exercise • Submits all recorded sensor data and confirmed (!) labels per session • Handles offline / travel modes • Synchronises the data across the user’s devices using iCloud
  • 6. © 2016 Cake Solutions Limited CC BY-NC-SA 4.0 The technologies—Akka • Reactive services for user profiles, model parameters, and sensor data • CQRS/ES implementation, which helps to • Handle peaks in load • Handle failures of individual nodes • Reason about the scope of the mutable state we keep • Uses Cassandra for its journal and snapshot stores • The written values are binary “blobs” • Writes the sensor data to Cassandra • Writes the sensor data in “readable” form; it can be read outside the Akka / Scala world • Reads the model and exercise parameters from Cassandra • It selects the best / newest model parameters to serve to the mobile app
  • 7. © 2016 Cake Solutions Limited CC BY-NC-SA 4.0 The technologies—Spark • Distributed computation framework • “Big data” tasks • Integrates extremely well with Cassandra • Reads and processes the profiles and sensor data • Identifies clusters of users on their profile information • Slices the sensor inputs by sensor types • Writes the results to another store • Runs in batches • Executes by schedule (typically once a day)
  • 8. © 2016 Cake Solutions Limited CC BY-NC-SA 4.0 The technologies—neon • A machine learning framework, including • “The usual” suspects in tensor algebra • Signal processing • Different ML approaches • Training and evaluation programs • Both programs terminate either upon discovering the perfect model or when their budget is up • Reads clustered training and testing data from the Spark job • Writes the model parameters and evaluation result to Cassandra
  • 9. © 2016 Cake Solutions Limited CC BY-NC-SA 4.0 The technologies—Cassandra • Underpins the entire platform • Journal and snapshot store for Akka • Sensor data store • Model parameter store • “Summary” store • High availability • No single point of failure • High read and write • Replication factor • Tuneable consistency level
  • 10. © 2016 Cake Solutions Limited CC BY-NC-SA 4.0
  • 11. © 2016 Cake Solutions Limited CC BY-NC-SA 4.0 Spark & Cassandra • Group the sensor data into n clusters by user profile with biometric ID • Expand the sensor data • Slices of the sensor data by combinations of accelerometer, gyroscope, heart rate, targeted muscle group strain gauges, … • 1 user = 1 MiB from one sensor per hour; but 4 sensors expand into 4! MiB • Trivial tasks • The most popular user–contributed exercises • The most popular exercise sessions and exercises within the sessions • The most effective (by overall fitness improvement, weight loss, muscle mass gain, …) exercise sessions
  • 12. © 2016 Cake Solutions Limited CC BY-NC-SA 4.0 Production ML Take the data from Cassandra (written there by the Spark jobs) and: • Split into training and test datasets • Fit models for various sensor types • Save model parameters • Evaluate the newly fitted models, and re-evaluate old data
  • 13. © 2016 Cake Solutions Limited CC BY-NC-SA 4.0 Production ML • We are using convolutional network • 2 seconds of sensor data input (e.g. a @ 50 Hz for accelerometer; a, g @ 50 Hz for accelerometer + gyroscope; u, l @ 10 Hz for smart clothes) • The exercise classes as the outputs • The training program • CNN in neon • Loads the mini–batches from Cassandra • Fits the model; evaluates the fitted model • Saves the model parameters into Cassandra • The re–evaluation program • Re–evaluates past n models against the latest training dataset; computing accuracy, precision, recall, f1
  • 14. © 2016 Cake Solutions Limited CC BY-NC-SA 4.0 Having code is jolly good
  • 15. © 2016 Cake Solutions Limited CC BY-NC-SA 4.0 Running it • Simplicity • Ease of orchestration • Ease of development • Support for polyglot frameworks and components • Cost effective resource utilisation
  • 16. © 2016 Cake Solutions Limited CC BY-NC-SA 4.0 Docker • Deploy reliably & consistently • Execution is fast and light weight • Simplicity • Developer friendly workflow • Fantastic community
  • 17. © 2016 Cake Solutions Limited CC BY-NC-SA 4.0 Dockerize Cassandra Dev Environment • Super low memory settings in cassandra-env.sh • MAX_HEAP_SIZE=“128M” • HEAP_NEWSIZE=“24M” • Remove caches in dev mode in cassandra.yml • key_cache_size_in_mb: 0 • reduce_cache_sizes_at: 0 • reduce_cache_capacity_to: 0
  • 18. © 2016 Cake Solutions Limited CC BY-NC-SA 4.0 Dockerize Cassandra Production • Use host networking (—net=host) for better network performance • Put data, commitlog and saved_caches in volume mount folders to the underlying host • Run cassandra on the foreground using (-f) • Tune JVM heap for optimal size • Tune JVM garbage collector for your workload
  • 19. © 2016 Cake Solutions Limited CC BY-NC-SA 4.0 Mesos • Distributed systems kernel • Scales to 10,000s of nodes • Depends on Zookeeper for fault tolerance and high availability • Creates a highly available, scalable single resource pool • Automatic failover • Ease of management • Simple to operate • Support for Docker container
  • 20. © 2016 Cake Solutions Limited CC BY-NC-SA 4.0 Mesos architecture image source: https://assets.digitalocean.com/articles/mesosphere/mesos_architecture.png
  • 21. © 2016 Cake Solutions Limited CC BY-NC-SA 4.0 Cassandra on Mesos • Running Cassandra as Docker containers • Custom Dockerfile and entry-point script to control Cassandra configuration • Marathon to initialize and control
  • 22. © 2016 Cake Solutions Limited CC BY-NC-SA 4.0 Cost effective resource in AWS • Embrace AWS spot instances • About 50-60% cheaper than on demand instances • Can be reclaimed without notice if outbidded • Run dev and staging on spot instances • Run Spark jobs on spot instances
  • 23. © 2016 Cake Solutions Limited CC BY-NC-SA 4.0
  • 24. © 2016 Cake Solutions Limited CC BY-NC-SA 4.0 Thanks! Twitter: @cakesolutions
 Tel: 0845 617 1200 Email: enquiries@cakesolutions.net Jobs: http://www.cakesolutions.net/ careers