• API
  • Datasets
  • Examples
  • Experiments
  • Learn
  • Code

Friendly Machine Learning for the Web.

ml5.js aims to make machine learning accessible to a broad audience of artists, creative coders, and students. The library provides access to machine learning algorithms and models in the browser, building on top of TensorFlow.js with no other external dependencies.

The library is supported by code examples, tutorials, and sample datasets with an emphasis on ethical computing. Bias in data, stereotypical harms, and responsible crowdsourcing are part of the documentation around data collection and usage.

Simple classification with a pre-trained model:

// Create the classifier

const classifier = new ml5.ImageClassifier('MobileNet');

// Make a prediction

let prediction = classifier.predict(img, gotResults);

function gotResults(results) {

  console.log(results);

}

A Wrapper Around TensorFlow.js

ml5.js is a friendly high level interface to TensorFlow.js, a library for handling GPU-accelerated mathematical operations and memory management for machine learning algorithms.

Models and Training

ml5.js provides immediate access in the browser to pre-trained models for detecting human poses, generating text, styling an image with another, composing music, pitch detection, and common English language word relationships.

Additionally, ml5.js provides an API for training new models based on pre-trained ones as well as training from custom user data from scratch.

Docs
Getting StartedAPI ReferenceTraining Models
Learning
TutorialsGlossaryResources
Contribute
ExperimentsContributing GuideStar
Facebook Open Source
This project is currently being maintained at NYU ITP by a community of teachers, residents and students.