SlideShare ist ein Scribd-Unternehmen logo
1 von 49
Downloaden Sie, um offline zu lesen
JSR 381
Visual Recognition for Java
Finally,
A Java-Friendly ML API
Gran Sasso
Frank Greco
@frankgreco
Chair
NYJavaSIG - NY Java User Group
JC, Cloud/Mobile Architect
Zoran Severac
@neuroph
AI Researcher
Univ of Belgrade, Serbia
JC, Apache NetBeans PMC
NullPointerExceptional
Session Topics
● Patterns and Machine Learning (ML)
● Why is ML Different than Conventional Programming
● Java and ML
● VisRec JSR 381
● VisRec Architecture and Implementation
● Examples
Patterns
And
Machine Learning
Machine Learning - Huge Impact on Everything...
Patterns...
“One of the most interesting aspects of
the world is that it can be considered to
be made up of patterns”
Norbert Wiener - 1894-1964 - MIT
Cybernetics (1948) - early steps to modern AI
This was AI before it was called “AI”
https://en.wikipedia.org/wiki/Christopher_Alexander
Learning a Foreign Language
Understand All Rules Observe/Follow Patterns
Where Else Does This Apply?
Where Else Does This Apply?
Any application that has a
large number of parameters
and lots of data
Weather
Trading
Cybersecurity
Medical
Diagnosis
Drug Discovery
Anti Spam
Agriculture
Ecommerce
Language
Translation
Autonomous
Transportation
Online Search
Call Centers
Social Media
Monitoring
Session Topics
● Patterns and Machine Learning (ML)
● Why is ML Different than Conventional Programming
● Java and ML
● VisRec JSR 381
● VisRec Architecture and Implementation
● Examples
T F
T F
T F
T F
FT FT
FT
FT
FT
T
F
ML - Basic Workflow
Obtaining, Organizing,
Cleaning, Removing Bias,
etc.
Selecting ML Algorithm, Parameter
Experimentation, Analyze Errors
Deploy Model
with jar/container
ML - Basic Workflow
Obtaining, Organizing,
Cleaning, Removing Bias,
etc.
Selecting ML Algorithm, Parameter
Experimentation, Analyze Errors
Deploy Model
with jar/container
ML - Basic Workflow
Obtaining, Organizing,
Cleaning, Removing Bias,
etc.
Selecting ML Algorithm, Parameter
Experimentation, Analyze Errors
Deploy Model
with jar/container
Session Topics
● Patterns and Machine Learning (ML)
● Why is ML Different than Conventional Programming
● Java and ML
● VisRec JSR 381
● VisRec Architecture and Implementation
● Examples
You can write your Machine
Learning app in any language
you want as long as its Python.
You can write your Machine
Learning app in any language
you want as long as its Python.
HEY!
HEY!
HEY!
HEY!
HEY!
HEY!
HEY!
HEY!
HEY!
HEY!
HEY!
HEY!
HEY!
HEY!
HEY!
HEY!
HEY!
HEY!
HEY!
HEY!
HEY!
HEY!
HEY!
HEY!
HEY!
HEY!
HEY!
HEY!
HEY!
HEY!
HEY!
HEY!
HEY!
HEY!
HEY!
HEY!
What the Hey!
HEY!
HEY!
HEY!
HEY!
HEY!
HEY!
HEY!
HEY!
HEY!
HEY!
HEY!
HEY!
HEY!
HEY!
HEY!
HEY!
HEY!
HEY!
HEY!
HEY!
12M Java Devs
Java Needs to be a First Class Citizen for ML
● Don’t want another JavaScript “Doomsday” Scenario occurring in
our Lifetime
● Python is a very good language. There should be others to
express the ML world’s creativity
● Java is a great language with a huge ecosystem with 12M
developers
● Existing ML APIs aren’t Java-friendly or AppDev-friendly
Everyone we talked was interested to collaborate
Session Topics
● Patterns and Machine Learning (ML)
● Why is ML Different than Conventional Programming
● Java and ML
● VisRec JSR 381
● VisRec Architecture and Implementation
● Examples
Don’t boil the ocean… [heat up some coffee first]
VisRec - JSR #381 Visual Recognition for Java
Spec Leads and Expert Group
Zoran Sevarac (ML researcher - Univ of Belgrade)
Frank Greco (NYJavaSIG, Consultant)
Kevin Berendsen (OpenValue, Senior Software Eng)
Other contributors and Advisors
● Frank Liu (Amazon)
● Constantin Drabo
● Amit Nagesh
● Marissa Staller
● Eric Bruno
● Anakar Parida
● Nikita Ivanov (Gridgain)
● James Weaver (IBM)
● Werner Keil
● Jyoti Buddha
● Guillaume Laforge (Google)
● Ed Burns (fmr Oracle)
● Nishant Raut (Mumbai JUG)
● Sandhya Kapoor (fmr IBM)
JSR 381 API,
Architecture, Implementations,
and Examples
JSR #381 - Visual Recognition API
●
●
●
●
●
● More readable and easier to use
VisRec JSR #381
https://github.com/JavaVisRec/visrec-api/wiki/Getting-Started-Guide
Issues with Existing Offerings
●
●
●
●
VisRec Design goals and principles
●
●
●
●
What Can you Do with It?
1) Classify images and data/objects
classification task
2) Estimate numeric value
regression task
3) Object Detection
classification + regression(position)
Generic ML Layer
Visual
Recognition
Image
Abstraction
VisRec Public API
Apps/Libs
Visual Recognition Layer
JSR381
Service Provider Interface
ML Engine 1
Service Provider Impl
ML Engine 2
Service Provider Impl
JSR 381
Architecture
Core Classes & Design
Generic ML Layer
(common abstractions,
interfaces for general ML
tasks)
Visual Rec Layer
(specialization of generic ML tasks for
specific objects / domain)
Implementation
Based on specific ML engine
DataSet<E> ImageSet extends
DataSet<ExampleImage>
Classifier<T, R>
BinaryClassifier<T>
MutliClassClassifier<T, R>
ImageClassifier<IMAGE_CLASS>
AbstractImageClassifier<IMAGE_CLASS
, MODEL> implements
ImageClassifier<IMAGE_CLASS>
ImageClassifierNetwork extends
AbstractImageClassifier<BufferedImage,
ConvolutionalNetwork>
Regressor<T, R>
SimpleLinearRegression<
MODEL_CLASS>
implements
Regressor<Float, Float>,
SimpleLinearRegressionNetwork extends
SimpleLinearRegression<FeedForwardN
etwork>
How to classify image
Build Classifier
ImageClassifier<BufferedImage> dukeClassifier =
NeuralNetImageClassifier.builder()
.inputClass(BufferedImage.class)
.imageHeight(64)
.imageWidth(64)
.labelsFile(new File("labels.txt"))
.trainingFile(new File("index.txt"))
.networkArchitecture(new File("duke_net.json"))
.exportModel(Paths.get("duke.dnet"))
.maxError(0.05f)
.maxEpochs(1000)
.learningRate(0.01f)
.build()
Use Classifier
BufferedImage image = ...
Map<String, Float> results = classifier.classify(image);
Full Example on GitHub
Running the Demo
Epoch:1, Time:686ms, TrainError:0.68538016, TrainErrorChange:0.68538016, TrainAccuracy: 0.91150445
Epoch:2, Time:505ms, TrainError:0.4474997, TrainErrorChange:-0.23788047, TrainAccuracy: 0.96460176
Epoch:3, Time:506ms, TrainError:0.28403035, TrainErrorChange:-0.16346934, TrainAccuracy: 0.96460176
Epoch:4, Time:479ms, TrainError:0.1824384, TrainErrorChange:-0.101591945, TrainAccuracy: 0.9734513
Epoch:5, Time:486ms, TrainError:0.123548426, TrainErrorChange:-0.058889978, TrainAccuracy: 0.99115044
Epoch:6, Time:493ms, TrainError:0.08493269, TrainErrorChange:-0.038615733, TrainAccuracy: 1.0
Minimal Configuration
● Image class
● Image dimensions
● Category labels (labels file)
● List of image files with corresponding category labels (index
file)
● Convolutional neural network architecture for image
classification
● Training parameters (max error, max epochs, learning rate)
● File name for the trained model
Under the hood: Convolutional Neural Network for Image Recognition
High dimensional data + automated preprocessing and feature extraction
Reference Implementation: Deep Netts
● Pure Java implementation of main Deep Learning algorithms:
convolutional and feed forward neural networks
● Open source (LGPL) and professional edition
● Pro Edition includes Deep Learning IDE
○ Visual ML Tools, Wizards and
● Starting today Pro Edition is available
Under FREE DEVELOPMENT license!
https://www.deepnetts.com/download
Image classification - Convolutional network using Deep Netts API
ConvolutionalNetwork neuralNet = ConvolutionalNetwork.builder()
.addInputLayer(imageWidth, imageHeight, 3)
.addConvolutionalLayer(3, 3, 12)
.addMaxPoolingLayer(2, 2)
.addFullyConnectedLayer(30)
.addFullyConnectedLayer(20)
.addOutputLayer(labelsCount, ActivationType.SOFTMAX)
.hiddenActivationFunction(ActivationType.TANH)
.lossFunction(LossType.CROSS_ENTROPY)
.randomSeed(123)
.build();
Next Steps for You!
github.com/JavaVisRec/visrec-api/wiki/Getting-Started-Guide
JSR 381
Visual Recognition for Java
Finally,
A Java-Friendly ML API
Please provide feedback
and contribute!
No reason why Java
cannot be used for ML!
Thank You!

Weitere ähnliche Inhalte

Ähnlich wie jChampions JSR381 Visual recognition for java

Build, Train, and Deploy ML Models at Scale
Build, Train, and Deploy ML Models at ScaleBuild, Train, and Deploy ML Models at Scale
Build, Train, and Deploy ML Models at ScaleAmazon Web Services
 
UMLassure: An approach to model software security
UMLassure: An approach to model software securityUMLassure: An approach to model software security
UMLassure: An approach to model software securitymanishthaper
 
JAVA Developer_Resume_Vaibhav Srivastav
JAVA Developer_Resume_Vaibhav SrivastavJAVA Developer_Resume_Vaibhav Srivastav
JAVA Developer_Resume_Vaibhav SrivastavVaibhav Srivastav
 
Project SpaceLock - Architecture & Design
Project SpaceLock - Architecture & DesignProject SpaceLock - Architecture & Design
Project SpaceLock - Architecture & DesignAbhishek Mishra
 
Get Hip with JHipster: Spring Boot + AngularJS + Bootstrap - Rich Web Experie...
Get Hip with JHipster: Spring Boot + AngularJS + Bootstrap - Rich Web Experie...Get Hip with JHipster: Spring Boot + AngularJS + Bootstrap - Rich Web Experie...
Get Hip with JHipster: Spring Boot + AngularJS + Bootstrap - Rich Web Experie...Matt Raible
 
Java Semimar Slide (Cetpa)
Java Semimar Slide (Cetpa)Java Semimar Slide (Cetpa)
Java Semimar Slide (Cetpa)Pratima Parida
 
Java Semimar Slide (Cetpa)
Java Semimar Slide (Cetpa)Java Semimar Slide (Cetpa)
Java Semimar Slide (Cetpa)Pratima Parida
 
10 interesting things about java
10 interesting things about java10 interesting things about java
10 interesting things about javakanchanmahajan23
 
BEST IMAGE PROCESSING TOOLS TO EXPECT in 2023 – Tutors India
BEST IMAGE PROCESSING TOOLS TO EXPECT in 2023 – Tutors IndiaBEST IMAGE PROCESSING TOOLS TO EXPECT in 2023 – Tutors India
BEST IMAGE PROCESSING TOOLS TO EXPECT in 2023 – Tutors IndiaTutors India
 
Framework engineering JCO 2011
Framework engineering JCO 2011Framework engineering JCO 2011
Framework engineering JCO 2011YoungSu Son
 
Presentation1.2.pptx
Presentation1.2.pptxPresentation1.2.pptx
Presentation1.2.pptxpranaykusuma
 
Developing Java Web Applications
Developing Java Web ApplicationsDeveloping Java Web Applications
Developing Java Web Applicationshchen1
 
Software Modeling and Artificial Intelligence: friends or foes?
Software Modeling and Artificial Intelligence: friends or foes?Software Modeling and Artificial Intelligence: friends or foes?
Software Modeling and Artificial Intelligence: friends or foes?Jordi Cabot
 
Get Hip with JHipster - Colorado Springs OSS Meetup April 2016
Get Hip with JHipster - Colorado Springs OSS Meetup April 2016Get Hip with JHipster - Colorado Springs OSS Meetup April 2016
Get Hip with JHipster - Colorado Springs OSS Meetup April 2016Matt Raible
 
Google App Engine for Java v0.0.2
Google App Engine for Java v0.0.2Google App Engine for Java v0.0.2
Google App Engine for Java v0.0.2Matthew McCullough
 
MLFlow: Platform for Complete Machine Learning Lifecycle
MLFlow: Platform for Complete Machine Learning Lifecycle MLFlow: Platform for Complete Machine Learning Lifecycle
MLFlow: Platform for Complete Machine Learning Lifecycle Databricks
 
Pharo: A Reflective System
Pharo: A Reflective SystemPharo: A Reflective System
Pharo: A Reflective SystemPharo
 

Ähnlich wie jChampions JSR381 Visual recognition for java (20)

Build, Train, and Deploy ML Models at Scale
Build, Train, and Deploy ML Models at ScaleBuild, Train, and Deploy ML Models at Scale
Build, Train, and Deploy ML Models at Scale
 
UMLassure: An approach to model software security
UMLassure: An approach to model software securityUMLassure: An approach to model software security
UMLassure: An approach to model software security
 
JAVA Developer_Resume_Vaibhav Srivastav
JAVA Developer_Resume_Vaibhav SrivastavJAVA Developer_Resume_Vaibhav Srivastav
JAVA Developer_Resume_Vaibhav Srivastav
 
Project SpaceLock - Architecture & Design
Project SpaceLock - Architecture & DesignProject SpaceLock - Architecture & Design
Project SpaceLock - Architecture & Design
 
Get Hip with JHipster: Spring Boot + AngularJS + Bootstrap - Rich Web Experie...
Get Hip with JHipster: Spring Boot + AngularJS + Bootstrap - Rich Web Experie...Get Hip with JHipster: Spring Boot + AngularJS + Bootstrap - Rich Web Experie...
Get Hip with JHipster: Spring Boot + AngularJS + Bootstrap - Rich Web Experie...
 
Java Semimar Slide (Cetpa)
Java Semimar Slide (Cetpa)Java Semimar Slide (Cetpa)
Java Semimar Slide (Cetpa)
 
Java Semimar Slide (Cetpa)
Java Semimar Slide (Cetpa)Java Semimar Slide (Cetpa)
Java Semimar Slide (Cetpa)
 
10 interesting things about java
10 interesting things about java10 interesting things about java
10 interesting things about java
 
BEST IMAGE PROCESSING TOOLS TO EXPECT in 2023 – Tutors India
BEST IMAGE PROCESSING TOOLS TO EXPECT in 2023 – Tutors IndiaBEST IMAGE PROCESSING TOOLS TO EXPECT in 2023 – Tutors India
BEST IMAGE PROCESSING TOOLS TO EXPECT in 2023 – Tutors India
 
Framework engineering JCO 2011
Framework engineering JCO 2011Framework engineering JCO 2011
Framework engineering JCO 2011
 
Presentation1.2.pptx
Presentation1.2.pptxPresentation1.2.pptx
Presentation1.2.pptx
 
Dev381.Pp
Dev381.PpDev381.Pp
Dev381.Pp
 
Developing Java Web Applications
Developing Java Web ApplicationsDeveloping Java Web Applications
Developing Java Web Applications
 
Software Modeling and Artificial Intelligence: friends or foes?
Software Modeling and Artificial Intelligence: friends or foes?Software Modeling and Artificial Intelligence: friends or foes?
Software Modeling and Artificial Intelligence: friends or foes?
 
Get Hip with JHipster - Colorado Springs OSS Meetup April 2016
Get Hip with JHipster - Colorado Springs OSS Meetup April 2016Get Hip with JHipster - Colorado Springs OSS Meetup April 2016
Get Hip with JHipster - Colorado Springs OSS Meetup April 2016
 
ThesisProposal
ThesisProposalThesisProposal
ThesisProposal
 
Google App Engine for Java v0.0.2
Google App Engine for Java v0.0.2Google App Engine for Java v0.0.2
Google App Engine for Java v0.0.2
 
Java seminar
Java seminarJava seminar
Java seminar
 
MLFlow: Platform for Complete Machine Learning Lifecycle
MLFlow: Platform for Complete Machine Learning Lifecycle MLFlow: Platform for Complete Machine Learning Lifecycle
MLFlow: Platform for Complete Machine Learning Lifecycle
 
Pharo: A Reflective System
Pharo: A Reflective SystemPharo: A Reflective System
Pharo: A Reflective System
 

Kürzlich hochgeladen

React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaHanief Utama
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...Technogeeks
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfMarharyta Nedzelska
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odishasmiwainfosol
 
VK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web DevelopmentVK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web Developmentvyaparkranti
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作qr0udbr0
 
Precise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalPrecise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalLionel Briand
 
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsSensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsChristian Birchler
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEEVICTOR MAESTRE RAMIREZ
 
Machine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringMachine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringHironori Washizaki
 
Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfIntroduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfFerryKemperman
 
Understanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM ArchitectureUnderstanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM Architecturerahul_net
 
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...OnePlan Solutions
 
Sending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdfSending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdf31events.com
 
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxReal-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxRTS corp
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Velvetech LLC
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Matt Ray
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationBradBedford3
 
Salesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZSalesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZABSYZ Inc
 

Kürzlich hochgeladen (20)

React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdf
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
 
VK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web DevelopmentVK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web Development
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作
 
Precise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalPrecise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive Goal
 
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsSensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
 
2.pdf Ejercicios de programación competitiva
2.pdf Ejercicios de programación competitiva2.pdf Ejercicios de programación competitiva
2.pdf Ejercicios de programación competitiva
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEE
 
Machine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringMachine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their Engineering
 
Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfIntroduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdf
 
Understanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM ArchitectureUnderstanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM Architecture
 
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
 
Sending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdfSending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdf
 
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxReal-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion Application
 
Salesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZSalesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZ
 

jChampions JSR381 Visual recognition for java

  • 1. JSR 381 Visual Recognition for Java Finally, A Java-Friendly ML API Gran Sasso
  • 2. Frank Greco @frankgreco Chair NYJavaSIG - NY Java User Group JC, Cloud/Mobile Architect Zoran Severac @neuroph AI Researcher Univ of Belgrade, Serbia JC, Apache NetBeans PMC NullPointerExceptional
  • 3. Session Topics ● Patterns and Machine Learning (ML) ● Why is ML Different than Conventional Programming ● Java and ML ● VisRec JSR 381 ● VisRec Architecture and Implementation ● Examples
  • 5. Machine Learning - Huge Impact on Everything...
  • 7.
  • 8. “One of the most interesting aspects of the world is that it can be considered to be made up of patterns” Norbert Wiener - 1894-1964 - MIT Cybernetics (1948) - early steps to modern AI This was AI before it was called “AI”
  • 9.
  • 11. Learning a Foreign Language Understand All Rules Observe/Follow Patterns
  • 12. Where Else Does This Apply?
  • 13. Where Else Does This Apply? Any application that has a large number of parameters and lots of data
  • 16. Session Topics ● Patterns and Machine Learning (ML) ● Why is ML Different than Conventional Programming ● Java and ML ● VisRec JSR 381 ● VisRec Architecture and Implementation ● Examples
  • 17. T F T F T F T F FT FT FT FT FT T F
  • 18.
  • 19.
  • 20.
  • 21. ML - Basic Workflow Obtaining, Organizing, Cleaning, Removing Bias, etc. Selecting ML Algorithm, Parameter Experimentation, Analyze Errors Deploy Model with jar/container
  • 22. ML - Basic Workflow Obtaining, Organizing, Cleaning, Removing Bias, etc. Selecting ML Algorithm, Parameter Experimentation, Analyze Errors Deploy Model with jar/container
  • 23. ML - Basic Workflow Obtaining, Organizing, Cleaning, Removing Bias, etc. Selecting ML Algorithm, Parameter Experimentation, Analyze Errors Deploy Model with jar/container
  • 24. Session Topics ● Patterns and Machine Learning (ML) ● Why is ML Different than Conventional Programming ● Java and ML ● VisRec JSR 381 ● VisRec Architecture and Implementation ● Examples
  • 25. You can write your Machine Learning app in any language you want as long as its Python.
  • 26. You can write your Machine Learning app in any language you want as long as its Python. HEY!
  • 28. Java Needs to be a First Class Citizen for ML ● Don’t want another JavaScript “Doomsday” Scenario occurring in our Lifetime ● Python is a very good language. There should be others to express the ML world’s creativity ● Java is a great language with a huge ecosystem with 12M developers ● Existing ML APIs aren’t Java-friendly or AppDev-friendly
  • 29. Everyone we talked was interested to collaborate
  • 30. Session Topics ● Patterns and Machine Learning (ML) ● Why is ML Different than Conventional Programming ● Java and ML ● VisRec JSR 381 ● VisRec Architecture and Implementation ● Examples
  • 31. Don’t boil the ocean… [heat up some coffee first] VisRec - JSR #381 Visual Recognition for Java Spec Leads and Expert Group Zoran Sevarac (ML researcher - Univ of Belgrade) Frank Greco (NYJavaSIG, Consultant) Kevin Berendsen (OpenValue, Senior Software Eng)
  • 32. Other contributors and Advisors ● Frank Liu (Amazon) ● Constantin Drabo ● Amit Nagesh ● Marissa Staller ● Eric Bruno ● Anakar Parida ● Nikita Ivanov (Gridgain) ● James Weaver (IBM) ● Werner Keil ● Jyoti Buddha ● Guillaume Laforge (Google) ● Ed Burns (fmr Oracle) ● Nishant Raut (Mumbai JUG) ● Sandhya Kapoor (fmr IBM)
  • 33. JSR 381 API, Architecture, Implementations, and Examples
  • 34. JSR #381 - Visual Recognition API ● ● ● ● ● ● More readable and easier to use VisRec JSR #381 https://github.com/JavaVisRec/visrec-api/wiki/Getting-Started-Guide
  • 35. Issues with Existing Offerings ● ● ● ●
  • 36. VisRec Design goals and principles ● ● ● ●
  • 37. What Can you Do with It? 1) Classify images and data/objects classification task 2) Estimate numeric value regression task 3) Object Detection classification + regression(position)
  • 38. Generic ML Layer Visual Recognition Image Abstraction VisRec Public API Apps/Libs Visual Recognition Layer JSR381 Service Provider Interface ML Engine 1 Service Provider Impl ML Engine 2 Service Provider Impl JSR 381 Architecture
  • 39. Core Classes & Design Generic ML Layer (common abstractions, interfaces for general ML tasks) Visual Rec Layer (specialization of generic ML tasks for specific objects / domain) Implementation Based on specific ML engine DataSet<E> ImageSet extends DataSet<ExampleImage> Classifier<T, R> BinaryClassifier<T> MutliClassClassifier<T, R> ImageClassifier<IMAGE_CLASS> AbstractImageClassifier<IMAGE_CLASS , MODEL> implements ImageClassifier<IMAGE_CLASS> ImageClassifierNetwork extends AbstractImageClassifier<BufferedImage, ConvolutionalNetwork> Regressor<T, R> SimpleLinearRegression< MODEL_CLASS> implements Regressor<Float, Float>, SimpleLinearRegressionNetwork extends SimpleLinearRegression<FeedForwardN etwork>
  • 40. How to classify image Build Classifier ImageClassifier<BufferedImage> dukeClassifier = NeuralNetImageClassifier.builder() .inputClass(BufferedImage.class) .imageHeight(64) .imageWidth(64) .labelsFile(new File("labels.txt")) .trainingFile(new File("index.txt")) .networkArchitecture(new File("duke_net.json")) .exportModel(Paths.get("duke.dnet")) .maxError(0.05f) .maxEpochs(1000) .learningRate(0.01f) .build() Use Classifier BufferedImage image = ... Map<String, Float> results = classifier.classify(image); Full Example on GitHub
  • 41. Running the Demo Epoch:1, Time:686ms, TrainError:0.68538016, TrainErrorChange:0.68538016, TrainAccuracy: 0.91150445 Epoch:2, Time:505ms, TrainError:0.4474997, TrainErrorChange:-0.23788047, TrainAccuracy: 0.96460176 Epoch:3, Time:506ms, TrainError:0.28403035, TrainErrorChange:-0.16346934, TrainAccuracy: 0.96460176 Epoch:4, Time:479ms, TrainError:0.1824384, TrainErrorChange:-0.101591945, TrainAccuracy: 0.9734513 Epoch:5, Time:486ms, TrainError:0.123548426, TrainErrorChange:-0.058889978, TrainAccuracy: 0.99115044 Epoch:6, Time:493ms, TrainError:0.08493269, TrainErrorChange:-0.038615733, TrainAccuracy: 1.0
  • 42. Minimal Configuration ● Image class ● Image dimensions ● Category labels (labels file) ● List of image files with corresponding category labels (index file) ● Convolutional neural network architecture for image classification ● Training parameters (max error, max epochs, learning rate) ● File name for the trained model
  • 43. Under the hood: Convolutional Neural Network for Image Recognition High dimensional data + automated preprocessing and feature extraction
  • 44. Reference Implementation: Deep Netts ● Pure Java implementation of main Deep Learning algorithms: convolutional and feed forward neural networks ● Open source (LGPL) and professional edition ● Pro Edition includes Deep Learning IDE ○ Visual ML Tools, Wizards and ● Starting today Pro Edition is available Under FREE DEVELOPMENT license! https://www.deepnetts.com/download
  • 45. Image classification - Convolutional network using Deep Netts API ConvolutionalNetwork neuralNet = ConvolutionalNetwork.builder() .addInputLayer(imageWidth, imageHeight, 3) .addConvolutionalLayer(3, 3, 12) .addMaxPoolingLayer(2, 2) .addFullyConnectedLayer(30) .addFullyConnectedLayer(20) .addOutputLayer(labelsCount, ActivationType.SOFTMAX) .hiddenActivationFunction(ActivationType.TANH) .lossFunction(LossType.CROSS_ENTROPY) .randomSeed(123) .build();
  • 46.
  • 47. Next Steps for You! github.com/JavaVisRec/visrec-api/wiki/Getting-Started-Guide
  • 48. JSR 381 Visual Recognition for Java Finally, A Java-Friendly ML API Please provide feedback and contribute! No reason why Java cannot be used for ML!