Image Classification
Machine Learning
Note: The Classification and Rules nodes are available in the Pro version of Retrobatch.
From Wikipedia: "Rule-based machine learning is a general term for any machine learning method that identifies, learns, or evolves `rules’ to store, manipulate or apply, knowledge. The defining characteristic of a rule-based machine learner is the identification and utilization of a set of relational rules that collectively represent the knowledge captured by the system."
How to See Classifications of an Image
- Add your folder of images to Retrobatch.
- Go to the Nodes list on the lefthand column, and double click on 'Sort'.
- Double click on 'Classify Images' to bring this node onto your canvas.
- Click on an individual image in the Preview to select it.
- Click on the 'i' in the lower righthand corner of the canvas.
- A pop-over will appear, and the classifications will be listed along with their percent confidence.
Using Classification Node with Rules node
The Rules node filters out images based on set criteria. Click the '+' button in the inspector palette when the Rules node is selected to add additional rules criteria to the node. The Classification node must be present in the workflow prior to the Rules node. Options within the Rules node that are relevant to Classifications include:
- Top Classification: Option for sorting images based on whether the top classification term for that image contains, matches, is like, begins with, ends with, is, is not....compared to the manually entered text.
- Any Classification: Option for sorting images taking into account the first 20 classifications for an image with a classification confidence greater than 1%. Choose whether the image classification term contains, matches, is like, begins with, ends with, is, is not....compared to the manually entered text.
- Classification Confidence: Options for separating images based on manually entered classification confidence, and whether image is greater than, equal to, or less than this percentage value.
Additional Classification Models
Retrobatch allows you to choose additional CoreML classification models (Retrobatch uses MobileNet) to analyze images. Once downloaded, you can place them in your ~/Library/Application Support/Retrobatch/MLModels/ folder, restart Retrobatch, and they will then show up in the Classification node.
Additional CoreML models can be downloaded from:
Tips and Tricks with Classifications
Some terms are not frequently used in certain classification models. The more you look at images and the classifications that come along with them, the easier it is to pick a term in the Rules node that will sort the images you want. For example, the word 'mountain' is not frequently used in some models, but most images of mountains will have the classification of 'valley' or 'alp' or 'cliff'.
Choose 'Any Classification' in the Rules node for increased results when sorting images by a classification.
Many classification models are not able to ascertain that a person or people are in an image. But, using terms such as wig, shirt, gown, and skirt in Rules can help to pull out pictures with people in them.
Holding down the option key to duplicate a Rules node that is set up to sort images that 'contain' a classification is a quick way to create a branch to your workflow to sort images into folders that do not contain those classifications. Just change the top dropdown menu of the duplicated Rules node to 'none', and add a Write Images node (see example workflow image above).
Other Relevant Documentation
-
Video Tutorials: Use machine learning to classify and sort images.
-
Hotdog or Not Template Workflow: Navigate to File ▸ New Workflow from Template ▸ Hotdog or Not?
Read Folder → Classify Images → Rules → Write Images
The Rules node is set up to pull out any images whose classification includes 'hotdog'. Image classification information can be found by clicking on an image in the scrubber, then clicking the 'i' in the lower righthand corner of the window.