Repository navigation
Structure Recognition
This page covers experimental local image-to-structure recognition with the optional MolScribe OCSR plugin and the review required before insertion.
OCSR means optical chemical structure recognition: turning pixels into atoms and bonds. The official Structure from Image (MolScribe) plugin uses the external MolScribe recognition project through ChemDraft's host-managed engine.
Recognition is experimental. A clean-looking result can still contain a wrong atom, bond, charge, isotope, or stereocentre. The model was trained on clean computer-drawn structures; hand-drawn strokes, sketch effects, coloured rings, and grid or axis lines crossing the drawing are documented problem cases.
ChemDraft therefore uses proposal review for every recognition. The plugin cannot insert directly, and a confidence label never replaces your inspection.
Choose Plugins → Add or Remove Plugins… and review the MolScribe plugin's installation offer. The catalog installation review explains that the local recognition engine comes with it, including download and disk-space information, before you confirm.
The engine downloads only after explicit user action. It includes a private Python environment, inference dependencies, and model weights. The documented download is about 2.5 GB, and the installer checks for at least 3 GB free. Those are installation estimates/requirements rather than a universal final installed size.
If engine installation fails or is cancelled, the plugin can remain installed. The manager offers Install engine again. Invoking recognition without the engine also opens a first-use installation flow. Once installed, recognition runs on this computer; the image is not sent to a remote recognition service.
- Choose Analyze → Recognize Structure from Image.
- Choose an image file or capture the required screen region through the host's image input.
- Wait for local recognition, or resolve a missing-engine message.
- Review the source image against the proposed drawing and its SMILES, confidence tier, and warnings.
- Accept only after checking chemical meaning, or reject the proposal and correct the input or draw the structure manually.
On macOS the menu is app-wide; on Windows use the document window's menu. The source image stays unless you delete it. Accepting a proposal creates an undoable document change; recognition does not silently replace the image with its interpretation.
Check each element label, bond order, connected component, formal charge, radical, isotope label, and stereochemical mark. Read the structure data and warnings as well as the picture: information retained in data may not be drawn by a particular depiction route.
The reported score belongs to the model. Its high/medium/low or missing-confidence tier is not a calibrated probability of correctness. Multiple agreeing recognition runs also do not establish certainty; they can repeat the same error.
| Warning area | What to inspect |
|---|---|
| Low or missing confidence | The whole interpretation, especially weakly recognized atoms and bonds |
| Stereochemistry | Wedges, hashes, double-bond geometry, and unspecified centres |
| Charge or radical | Charge signs, radical marks, and the resulting hydrogen/valence state |
| Abbreviations or superatoms | Expanded groups, aliases, R-groups, and wildcard atoms |
| Isotope/radical depiction | Whether information retained in structure data is visible in the drawing |
| Invalid structure | Invalid or unsanitized structure data is reported rather than proposed as valid chemistry |
Model reliability and chemical validity are separate questions. A parsable molecular graph can still be the wrong interpretation of the image. Conversely, a failed recognition does not imply the source molecule is invalid.
The plugin declares image.read, ml.inference, model.load, native.execute, document.proposePatch, ui.menu, and ui.panel. It receives recognition.recognizeStructure only for an image the host returned during the same command.
It declares neither model.download nor document.write. ChemDraft owns engine download/install approval and process management; the plugin owns the recognition request and proposal presentation. See Plugin Permissions.
The pinned engine supports an implemented macOS Apple-silicon path. Intel Macs are reported unsupported before downloads because the current dependency pins lack the required wheel. Windows x64 installation and relocation code exists, and a launcher-repair command was checked manually on Windows, but automated validation and complete installation/cancellation/process-cleanup checks remain pending in the architecture record. This is not a claim of a fully verified Windows recognition workflow.
The plugin and engine have separate lifetimes. Removing the plugin while the engine is installed asks whether to remove the engine too. The manager exposes engine size and removal while the plugin is installed; see Installing and Updating Plugins.
ChemDraft repository · Apache-2.0 · Home
- Features overview
- Installation
- Quick Start
- Your first molecule
- FAQ
- Troubleshooting
- Glossary
- macOS and Windows differences
- Drawing basics
- Atoms and labels
- Bonds and stereochemistry
- Rings and chains
- Selection and editing
- Charges, radicals, and dative bonds
- Copy, paste, and clipboard
- Keyboard shortcuts
- Toolbars and palettes
- Documents, pages, and tabs
- Arrows and mechanisms
- Art objects and styling
- Publication figures and style presets
- Compound layouts
- Templates and abbreviations
- Chemistry guarantees
- Analysis and properties
- NMR prediction
- Name from structure
- Name to structure
- Structure recognition
- Spin 3D