File size: 1,349 Bytes
16db197
 
 
 
 
 
 
7ac86dc
 
06ba586
7ac86dc
 
c528a1b
 
06ba586
7ac86dc
 
 
 
 
16db197
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
f919a89
16db197
06ba586
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
---
library_name: glyph
pipeline_tag: image-to-text
tags: [chemistry, ocsr, optical-chemical-structure-recognition, image-to-smiles]
---
# OCSRGlyph

## Installing the code

The commands below use the **`glyph`** package. Install it from the code repository:

```bash
git clone https://github.com/EdisonScientific/glyph
cd glyph
uv venv && uv sync --extra ocsr # or: pip install -e ".[ocsr]"
```

See the repo's `README.md` (quickstart + inference) and `REPRODUCE.md` (frozen eval contract).


Optical Chemical Structure Recognition for ordinary molecules: image -> SMILES. Swin-B/384 image encoder + a
6-layer transformer decoder (single inference model; ImageNet-pretrained backbone, no OCSR-specific pretraining).

## Results - USPTO-OCSR-5719 (greedy decode, light postprocess)

| Convention | Full 5719 | Parseable 5704 |
|---|---|---|
| A - canonical (full stereo) | 5362/5719 = **93.8%** | 93.97% |
| B - chirality-kept | 5372/5719 = **93.9%** | 94.14% |
| C - graph (connectivity) | 5499/5719 = **96.2%** | 96.35% |
| valid SMILES | - | 99.79% |

## Usage
```bash
glyph ocsr eval --checkpoint EdisonScientific/OCSRGlyph --benchmark <uspto_ocsr_5719_complete.csv>
```
See the code repository's `REPRODUCE.md` for the full contract. Files: `model.pth`, `ocsrglyph-recipe.json`.

**License:** pending. **Citation:** to be added on publication.