SlideShare a Scribd company logo
1 of 49
Download to read offline
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!

More Related Content

Similar to 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
 

Similar to 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
 

Recently uploaded

W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
Clustering techniques data mining book ....
Clustering techniques data mining book ....Clustering techniques data mining book ....
Clustering techniques data mining book ....ShaimaaMohamedGalal
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 

Recently uploaded (20)

W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
Clustering techniques data mining book ....
Clustering techniques data mining book ....Clustering techniques data mining book ....
Clustering techniques data mining book ....
 
Exploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the ProcessExploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the Process
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 

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!