<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Research-Methodology on Hunter Heidenreich | Senior AI Research Scientist</title><link>https://hunterheidenreich.com/tags/research-methodology/</link><description>Recent content in Research-Methodology on Hunter Heidenreich | Senior AI Research Scientist</description><image><title>Hunter Heidenreich | Senior AI Research Scientist</title><url>https://hunterheidenreich.com/img/avatar.webp</url><link>https://hunterheidenreich.com/img/avatar.webp</link></image><generator>Hugo -- 0.163.3</generator><language>en-US</language><copyright>2026 Hunter Heidenreich</copyright><lastBuildDate>Sun, 02 Aug 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://hunterheidenreich.com/tags/research-methodology/index.xml" rel="self" type="application/rss+xml"/><item><title>What Surprised Me About Aligning Pictures of Molecules</title><link>https://hunterheidenreich.com/posts/aligning-pictures-of-molecules/</link><pubDate>Sun, 02 Aug 2026 00:00:00 +0000</pubDate><guid>https://hunterheidenreich.com/posts/aligning-pictures-of-molecules/</guid><description>Two alignment objectives compared under a frozen and then a trainable vision backbone, a metric that scored a perfect model at chance, and a reversal.</description><content:encoded><![CDATA[<p>The <a href="https://arxiv.org/abs/2510.18900">MIST paper</a> makes a claim I wanted to test from an angle its authors did not take. They show that their model&rsquo;s embedding space organizes chemical concepts along physically meaningful directions. Lipinski&rsquo;s Rule of Five is linearly decodable from frozen activations. Unsupervised projections of the embeddings separate aromatic from anti-aromatic compounds along Hückel&rsquo;s rule, and none of that was labelled during training.</p>
<p>All of that structure is derived from a <a href="/notes/chemistry/molecular-representations/notations/smiles/">SMILES</a> string.</p>
<p>Molecules are also drawn. A structure diagram carries the same topology a chemist reads directly off the page, in a form no language model ever sees. So I wanted to know whether MIST&rsquo;s geometry is reachable from pixels, or whether it is a property of the string.</p>
<p>There are two standard ways to teach one model to land where another one does. You can push negatives apart with a contrastive loss, or you can skip the negatives and regress the target directly. I expected the predictive one to transfer better to real drawings, because a contrastive objective can exploit shortcuts that only exist inside a training batch. I wrote that down before running anything.</p>
<p>It held, then it reversed, and the mechanism I had named for it was wrong in both cases.</p>
<h2 id="what-i-built">What I Built</h2>
<p>One vision tower, one frozen text tower, and a single linear map between them.</p>
<table>
	<thead>
			<tr>
					<th></th>
					<th></th>
			</tr>
	</thead>
	<tbody>
			<tr>
					<td>Vision tower</td>
					<td><a href="https://arxiv.org/abs/2304.07193">DINOv2</a> ViT-S/14 with registers, 21,629,952 parameters, 384-d output</td>
			</tr>
			<tr>
					<td>Text tower</td>
					<td>MIST-28M, frozen throughout, pooled <code>last_hidden_state[:, 0, :]</code>, 512-d output</td>
			</tr>
			<tr>
					<td>Head</td>
					<td>one linear map, 384 to 512, 197,120 parameters</td>
			</tr>
			<tr>
					<td>Training data</td>
					<td>1M PubChem molecules, about 2M <a href="https://github.com/OBrink/RanDepict">RanDepict</a> depictions at 224px</td>
			</tr>
			<tr>
					<td>Schedule</td>
					<td>24 epochs, batch 256</td>
			</tr>
	</tbody>
</table>
<p>Arm A optimizes the <a href="https://arxiv.org/abs/2303.15343">SigLIP</a> sigmoid pairwise loss. Arm B regresses the frozen target in latent space with a smooth-L1 loss and no negatives, which is the <a href="https://arxiv.org/abs/2301.08243">I-JEPA</a> move applied as an alignment head rather than as pretraining. Everything else is held identical: same molecules, same splits, same seed, same schedule, same evaluation, checked by an assertion before any table prints. Every number below is one seed.</p>
<p>Two details in the setup are load-bearing.</p>
<p>The pooling is MIST&rsquo;s own. Their embedding is the last-layer hidden state at the first token, so anything else measures a different space. Loading the checkpoint with <code>AutoModel</code> also attaches a randomly initialized pooler unless you ask it not to, and <code>pooler_output</code> from that pooler returns plausible noise.</p>
<p>The contrastive labels come from molecular identity rather than batch position. Two rows in a batch can be depictions of the same molecule, and treating them as negatives because they sit at different indices would penalize the model for being right. That detail matters more than it looks, and I will come back to it.</p>
<p>This is not an <a href="/posts/what-is-ocsr/">OCSR</a> contribution. Reading a molecule out of a picture is a mature field, and MolScribe, MolGrapher, DECIMER and Img2Mol all do it well. What is here is a controlled experiment about alignment objectives that happens to run on a domain with a real evaluation surface.</p>
<p>That domain has a catch worth stating early, because it shapes which number is the result. The training depictions are rendered from SMILES strings. A picture drawn from a string carries no information the string did not already have, so the in-distribution task is closer to inverting a renderer than to reading chemistry. Transfer to depictions that came from the world is the part that tests something. That is why the out-of-distribution slice is the headline and the in-distribution number is context.</p>
<p>I came to MIST from the tokenizer side. I had published <a href="/research/bpe-unigram-lm-smiles-vocabularies/">a controlled comparison of BPE and Unigram-LM over chemistry SMILES</a> a few weeks earlier, and MIST is a SMILES foundation model whose headline contribution is <a href="/notes/chemistry/molecular-representations/notations/smirk-tokenization-molecular-models/">its own tokenizer</a>. I was reading the paper closely for that reason and stayed for the embedding geometry.</p>
<h3 id="what-i-registered-in-advance">What I Registered In Advance</h3>
<p>Three predictions, committed before any training run existed:</p>
<blockquote>
<ol>
<li>Both arms will be near-ceiling on in-distribution synthetic retrieval, and that number on its own will mean almost nothing.</li>
<li>The arms will separate, if at all, on the WildMol-10k OOD slice and the scaffold-split linear probe. That gap is the result.</li>
<li>Arm B is expected to hold up better OOD, on the reasoning that regressing a fixed target cannot exploit in-batch shortcuts the way a contrastive objective can. This is a guess and is written down so it can be wrong in public.</li>
</ol>
</blockquote>
<p>I also registered what would count as a clean negative and ship as the result: both arms at or near chance on the OOD slice and the probe, with all baselines behaving correctly. That sentence turns out to matter more than the predictions do.</p>
<h3 id="what-had-to-pass-first">What Had To Pass First</h3>
<p>Four gates run before any headline number is believed, because a comparison between two arms says nothing if the harness scoring both of them is broken.</p>
<table>
	<thead>
			<tr>
					<th>gate</th>
					<th>result</th>
					<th>what it rules out</th>
			</tr>
	</thead>
	<tbody>
			<tr>
					<td>oracle retrieval, a perfect predictor</td>
					<td>R@1 = 1.0</td>
					<td>the retrieval harness itself</td>
			</tr>
			<tr>
					<td>MIST against Tanimoto similarity</td>
					<td>r = +0.42</td>
					<td>a target that carries no chemistry</td>
			</tr>
			<tr>
					<td>random-embedding control</td>
					<td>+0.0014 centered cosine</td>
					<td>a metric that leaks</td>
			</tr>
			<tr>
					<td>trivial image-statistics floor</td>
					<td>+0.0924 centered cosine</td>
					<td>mistaking ink for structure</td>
			</tr>
	</tbody>
</table>
<p>The image-statistics floor is the one that earns its keep below. It is what a model scores using nothing but coarse pixel statistics, and any headline has to clear it.</p>
<h2 id="a-perfect-model-scored-zero">A Perfect Model Scored Zero</h2>
<p>Raw cosine against MIST measures almost nothing. Its embeddings occupy a narrow cone, where two unrelated molecules sit at cosine 0.517 and a model that ignores its input entirely and emits the training centroid scores 0.720. So every cosine in this project is centered, and each side is centered by its own training-split mean:</p>
<p>$$ \mathrm{cc} = \cos\left(\hat{\mathbf{u}} - \bar{\hat{\mathbf{u}}}_{\text{train}},\ \mathbf{y} - \bar{\mathbf{y}}_{\text{train}}\right) $$</p>
<p>Chance is zero. Both centroids come from the training split, since centering a held-out set by its own mean leaks that set&rsquo;s geometry into its own score.</p>
<p>The version I shipped first subtracted the target centroid from both sides. That is valid only while the prediction sits at roughly the target&rsquo;s scale. Arm B&rsquo;s smooth-L1 pins it there. Arm A&rsquo;s loss L2-normalizes both sides internally, so it constrains the output norm not at all, and weight decay shrinks it with nothing opposing.</p>
<p>Take an oracle predictor $\hat{\mathbf{u}} = s\mathbf{y}$, whose true cosine is exactly 1 for every $s &gt; 0$:</p>
<table>
	<thead>
			<tr>
					<th>$s$</th>
					<th>$\lVert\hat{\mathbf{u}}\rVert$</th>
					<th>centered by target</th>
					<th>centered by own mean</th>
			</tr>
	</thead>
	<tbody>
			<tr>
					<td>1.00</td>
					<td>22.28</td>
					<td>+1.0000</td>
					<td>+0.9999</td>
			</tr>
			<tr>
					<td>0.50</td>
					<td>11.14</td>
					<td>+0.6100</td>
					<td>+0.9999</td>
			</tr>
			<tr>
					<td>0.10</td>
					<td>2.23</td>
					<td>+0.0453</td>
					<td>+0.9999</td>
			</tr>
			<tr>
					<td>0.045</td>
					<td>1.00</td>
					<td><strong>-0.0103</strong></td>
					<td>+0.9999</td>
			</tr>
	</tbody>
</table>
<p>A perfect model emitting unit-norm vectors scored below chance.</p>
<p>On the real 20K run, that defect scored a working contrastive model at +0.1088, inside noise of the +0.1058 image-statistics floor. Arm A&rsquo;s head was emitting norm 6.35 against MIST&rsquo;s 22.28. Under the corrected metric the same checkpoint scores +0.3052.</p>
<p>The uncomfortable part is what that number was. I had registered, in advance, that both arms landing at the floor with every baseline behaving correctly would be a clean negative and would ship as the result. The defect produced precisely that. Every exit criterion passed.</p>
<p>No test caught it. What caught it was asking what a perfect model would score under this metric, which is a question whose answer is knowable before you ask it.</p>
<p>Registering a prediction stops the goalposts moving once data exists. It does nothing at all about a defect that happens to confirm the prediction, and it makes that case more expensive rather than less, because the incentive to accept a number and stop looking is strongest exactly where you said the number would be.</p>
<p>There was a second defect of the same shape waiting. Had the contrastive labels come from batch position instead of molecular identity, the model would have been penalized for putting two depictions of one molecule in the same place. That depresses contrastive transfer and leaves predictive untouched, because only the contrastive loss reads other rows in the batch, which is prediction 3 arriving as an artifact of the label matrix.</p>
<h2 id="the-data-ran-out">The Data Ran Out</h2>
<p>With the backbone frozen, I fitted a log-linear law to the closed-form ridge ceiling over 1K to 16K molecules. It described that range well, at r = 0.9906. Extrapolated, it said 1M molecules would reach +0.600.</p>















<figure class="post-figure center ">
    <img src="/img/molecular-depiction-alignment/fig5-scaling-law.webp"
         alt="A line chart of ridge ceiling against molecule count on a log axis, with a fitted line extrapolated to one million and a measured point falling well below it"
         title="A line chart of ridge ceiling against molecule count on a log axis, with a fitted line extrapolated to one million and a measured point falling well below it"
         
         
         loading="lazy"
         class="post-image">
    
    <figcaption class="post-caption"><strong>The law was accurate where it was fitted and missed by 0.077 a decade and a half out.</strong> Fifty times the molecules bought +0.020 where the extrapolation predicted +0.088. The implied slope falls from 0.0517 to 0.0117 per decade, so another +0.05 would need roughly ten billion molecules.</figcaption>
    
</figure>

<p>Going from 796K to 1.6M depictions bought +0.0002.</p>
<p>The mechanism is in the features rather than the sample. On these images, 54.3% of DINOv2&rsquo;s feature variance is depiction style rather than molecular identity. Two renders of the same molecule sit at cosine 0.857, and two different molecules sit at 0.809, which leaves very little room between &ldquo;same structure&rdquo; and &ldquo;different structure&rdquo; for a linear head to work with.</p>















<figure class="post-figure center ">
    <img src="/img/molecular-depiction-alignment/fig6-style-pair.webp"
         alt="Two renderings of the same molecule side by side, one drawn with bold lines and implicit carbons, the other with thin grey lines and every carbon atom labelled"
         title="Two renderings of the same molecule side by side, one drawn with bold lines and implicit carbons, the other with thin grey lines and every carbon atom labelled"
         
         
         loading="lazy"
         class="post-image">
    
    <figcaption class="post-caption"><strong>One molecule, two renders from the training set.</strong> A chemist reads these as identical. Frozen DINOv2 puts same-molecule pairs at cosine 0.857 and different-molecule pairs at 0.809, and 54.3% of its feature variance on this data is drawing style.</figcaption>
    
</figure>

<p>A linear head can reorganize what the backbone encodes. It cannot manufacture what the backbone discarded. That showed up directly in the probes, where alignment helped on the tasks whose property the frozen features already carried and did nothing at all on three of seven.</p>
<p>This is the second prediction I made in advance and missed, and it was the more expensive one, because I had been about to spend on data.</p>
<h2 id="unfreezing-reversed-my-own-prediction">Unfreezing Reversed My Own Prediction</h2>
<p>Letting the backbone move changes the picture. I swept two trainable modes rather than picking one: LoRA at rank 16 on the attention projections of all twelve blocks, and the top four blocks plus the final norm. The top-blocks mode won on every layer, and LoRA was also 1.84x slower per step despite training 16x fewer parameters, because backward cost tracks how deep the pass goes rather than how many parameters update.</p>















<figure class="post-figure center ">
    <img src="/img/molecular-depiction-alignment/fig2-eval-layers.webp"
         alt="Three panels comparing frozen and unfrozen results for in-distribution retrieval, out-of-distribution retrieval, and centered cosine, each on its own scale"
         title="Three panels comparing frozen and unfrozen results for in-distribution retrieval, out-of-distribution retrieval, and centered cosine, each on its own scale"
         
         
         loading="lazy"
         class="post-image">
    
    <figcaption class="post-caption"><strong>Each layer moves, and by very different factors.</strong> In-distribution retrieval 9.6x, out-of-distribution 11.1x, centered cosine 1.7x. Distractor difficulty is matched between the two regimes rather than assumed, at median Tanimoto 0.348 against 0.349 in-distribution.</figcaption>
    
</figure>

<p>The out-of-distribution gate is what makes this mean something, and it matters because an earlier lever failed it. Running the backbone at its native 518px instead of 224 improved every synthetic-image metric, several by multiple standard deviations, and moved the real-depiction metric by less than one. That lever was fitting RanDepict&rsquo;s particular ink rather than learning chemistry. Unfreezing does not behave that way.</p>
<p>Then the registered prediction inverted.</p>















<figure class="post-figure center ">
    <img src="/img/molecular-depiction-alignment/fig3-prediction-reversal.webp"
         alt="Two paired slope panels showing retrieval from synthetic to real depictions, with the predictive arm holding flat under a frozen backbone and the contrastive arm winning under an unfrozen one"
         title="Two paired slope panels showing retrieval from synthetic to real depictions, with the predictive arm holding flat under a frozen backbone and the contrastive arm winning under an unfrozen one"
         
         
         loading="lazy"
         class="post-image">
    
    <figcaption class="post-caption"><strong>Frozen, the predictive arm holds and the contrastive arm drops 34%. Unfrozen, it inverts.</strong> Contrastive drops 23.3% against predictive&rsquo;s 42.6% and wins out of distribution outright, 0.4555 against 0.2847.</figcaption>
    
</figure>

<p>The ordering was a property of the frozen bottleneck rather than of the objectives. Give the contrastive objective a backbone it can actually shape and it is the one that degrades less.</p>
<p>Had I only run the frozen half, I would have published a confirmed prediction with a mechanism attached, and the mechanism would have been wrong. The number was fine. The explanation underneath it was not, and nothing in the frozen regime could have told me.</p>
<p>Prediction 1 was wrong outright, which is worth recording since I registered it as the boring one. I expected in-distribution retrieval to sit near ceiling and carry no information. It came in at 0.0617 and 0.0310 against a 0.0156 chance floor, which is why it is reported throughout rather than waved off.</p>















<figure class="post-figure center ">
    <img src="/img/molecular-depiction-alignment/fig4-probe-gap-closed.webp"
         alt="A bar chart of seven probe tasks showing the fraction of the DINOv2 to MIST gap closed by the frozen and unfrozen models, with a dashed line at parity"
         title="A bar chart of seven probe tasks showing the fraction of the DINOv2 to MIST gap closed by the frozen and unfrozen models, with a dashed line at parity"
         
         
         loading="lazy"
         class="post-image">
    
    <figcaption class="post-caption"><strong>All three of the frozen regime&rsquo;s nulls break.</strong> ESOL, Lipophilicity and Tox21 SR-MMP were the evidence for &lsquo;alignment only reorganizes&rsquo;. A movable backbone can acquire a property the frozen features had discarded.</figcaption>
    
</figure>

<p>On one fixed checkpoint, the aligned image embedding out-probes MIST-direct on 6 of 7 tasks, losing only BBBP. Best-of-eight beats it on 7 of 7, and I am not quoting that as the result because it is selection over eight tries. The honest reading is that MIST bounds MIST-reconstruction rather than every downstream task where vision carries independent signal.</p>
<h2 id="the-fairest-rule-picked-the-worst-checkpoint">The Fairest Rule Picked the Worst Checkpoint</h2>
<p>The two arms have losses on different scales, so selecting each on its own loss would compare two selection procedures rather than two objectives. I selected on centered cosine instead, the one metric both arms are measured by. Neutral by construction.</p>
<p>It chose epoch 1 of 24 for the contrastive arm, in both trainable modes.</p>















<figure class="post-figure center ">
    <img src="/img/molecular-depiction-alignment/fig1-training-curves.webp"
         alt="Validation centered cosine against epoch for all four runs, with the contrastive arm peaking at the first epoch and decaying while the predictive arm climbs"
         title="Validation centered cosine against epoch for all four runs, with the contrastive arm peaking at the first epoch and decaying while the predictive arm climbs"
         
         
         loading="lazy"
         class="post-image">
    
    <figcaption class="post-caption"><strong>The contrastive arm&rsquo;s centered cosine peaks almost immediately and decays for the rest of training</strong>, while its own loss falls sevenfold and every other measure improves. In-distribution retrieval at the selected epoch is 0.2265 against 0.5938 at the final one, a factor of 2.6.</figcaption>
    
</figure>

<p>I had written this down on the first day of the project, at the milestone where the two arms first ran side by side:</p>
<blockquote>
<p>Selecting on it hands Arm A its worst retrieval checkpoint. Selecting on retrieval instead would reverse the ranking and would be equally defensible and equally partial.</p>
</blockquote>
<p>And in the same entry, on why I was recording it at all:</p>
<blockquote>
<p>Recording it now, at M3, because it is exactly the kind of thing that gets quietly resolved in whichever direction the first table happened to point.</p>
</blockquote>
<p>I scoped that observation as measured outside the contrastive arm&rsquo;s viable regime, which was correct at the time. At 20K molecules there is no batch size that is both a real contrastive batch and a small fraction of the dataset, so the arm was running at 256 while SigLIP&rsquo;s own calibration assumes 16,384. Rebuilding at 1M fixed that, and the failure happened anyway, in the regime where it counted.</p>
<p>The obvious objection is that the constraint itself was the cause. Holding the learning rate, the schedule and the checkpoint rule identical across two objectives that optimize different things does not make a comparison fair, it handicaps whichever arm does not match the shared choice.</p>
<p>The repair would be to let each arm carry its own schedule, and gradient accumulation is the specific one that was on the table. I did not add it, and I still think that was right. Accumulation enlarges the contrastive arm&rsquo;s negative pool and does nothing for the predictive one, so adding it converts a comparison of objectives into a comparison of training budgets. That is a second bias rather than a smaller one.</p>
<p>What I did not do was change the rule after seeing what it cost. Retrofitting a selection criterion once results exist is the specific thing pre-registration exists to prevent, so both epochs are reported instead.</p>
<p>Three shared choices ended up bending against the contrastive arm, all in the same direction. Weight decay at 0.05 against a scale-invariant loss, which is what produced the metric defect. Batch 256 against a calibration assuming 16,384. A selection metric that measures direction agreement, which is close to what the predictive arm optimizes directly.</p>
<p>It won the layer I had named in advance as the deciding one anyway, 0.4555 against 0.2847. So the measured gap is a floor rather than an estimate.</p>
<h2 id="what-i-would-not-trust-here">What I Would Not Trust Here</h2>
<p>Three things would change a conclusion above, in order of how much.</p>
<p><strong>The probe splits shift in composition.</strong> ESOL&rsquo;s training split is 35% acyclic molecules against 0% of validation and test, and Tox21 is about 32%. Acyclic molecules have no Bemis-Murcko scaffold, so a scaffold split places them all in one group and that group is large enough to land in train. ESOL is the largest probe gain in this post, and it was scored on a held-out set with none of the molecules that make up a third of what it trained on.</p>
<p><strong>One seed, and the sigmas are uneven.</strong> The only repeats in the project are a 5-seed frozen sweep at 20K. Arm A retrieval sigma runs .002 to .005 and BBBP .004 to .011. The retrieval orderings clear that by roughly two orders of magnitude and are safe. Individual probe cells do not clear it, and several rows show test scores above validation, which is what noise on a small scaffold-split test set looks like.</p>
<p><strong>The predictive arm was truncated.</strong> It was still rising at epoch 24 in both modes, and 24 epochs was inherited from the frozen regime where it was enough. Its numbers are a lower bound, which cuts against this post&rsquo;s own conclusion.</p>
<h2 id="conclusion-one-number-cannot-rank-two-objectives">Conclusion: One Number Cannot Rank Two Objectives</h2>
<p>The comparison never resolved to a winner in the way I expected when I started, and the reason is more interesting than a winner would have been. Under a frozen backbone the predictive arm holds up better, and that ordering is a fact about the bottleneck. Under a trainable one the contrastive arm wins out of distribution, and it does so while carrying every shared-procedure handicap.</p>
<p>Three of the four things above were numbers I initially believed. A metric that scored a perfect model below chance, a scaling law that was accurate everywhere I had fitted it, and a selection rule that was neutral by construction. Each looked fine, and each was checkable in advance by asking what a known answer should be.</p>
<p>The one that still bothers me is the metric, because it produced the exact result I had written down as shippable. Pre-registration protected me from moving the goalposts and did nothing about that.</p>
<p><em>Code, weights and data are public. The <a href="https://github.com/hunter-heidenreich/molecular-depiction-alignment">repository</a> carries the full results, the harness gates and the pre-registration verbatim. The two aligned models are on Hugging Face as <a href="https://huggingface.co/hheiden/dinov2-mist-molecular-depiction-contrastive">contrastive</a> and <a href="https://huggingface.co/hheiden/dinov2-mist-molecular-depiction-predictive">predictive</a>, and the <a href="https://huggingface.co/datasets/hheiden/molecular-depiction-pairs-20k">20K depiction set</a> is published so the comparison can be re-run without standing up the rendering environment.</em></p>
]]></content:encoded></item><item><title>Molecular Depiction Alignment: Contrastive vs Predictive</title><link>https://hunterheidenreich.com/projects/molecular-depiction-alignment/</link><pubDate>Sun, 02 Aug 2026 00:00:00 +0000</pubDate><guid>https://hunterheidenreich.com/projects/molecular-depiction-alignment/</guid><description>A controlled comparison of contrastive and predictive alignment: one vision tower into a frozen chemistry encoder, everything but the objective held identical.</description><content:encoded><![CDATA[<h2 id="overview">Overview</h2>
<p>Two ways to align an image of a molecular structure diagram into the embedding space of a frozen chemistry language model, compared on one data and evaluation stack. A <a href="https://arxiv.org/abs/2304.07193">DINOv2</a> ViT-S/14-reg vision tower, a frozen <a href="https://arxiv.org/abs/2510.18900">MIST-28M</a> text tower, and a 197,120-parameter linear map between them.</p>
<p>Arm A optimizes the SigLIP sigmoid pairwise loss. Arm B regresses the frozen target directly in latent space with no negatives. Everything else is held identical, and an assertion checks that before any comparison table prints.</p>
<p>The comparison is the deliverable. The models are how it was obtained.</p>
<h2 id="results">Results</h2>
<p>Retrieval R@1 against 64-molecule galleries of nearest-Tanimoto distractors, chance 0.0156. Out-of-distribution is WildMol-10k, real depictions extracted from patents and papers, never trained on.</p>
<table>
	<thead>
			<tr>
					<th></th>
					<th>frozen backbone</th>
					<th></th>
					<th>trainable backbone</th>
					<th></th>
			</tr>
	</thead>
	<tbody>
			<tr>
					<td></td>
					<td>contrastive</td>
					<td>predictive</td>
					<td>contrastive</td>
					<td>predictive</td>
			</tr>
			<tr>
					<td>in-distribution</td>
					<td>0.0617</td>
					<td>0.0310</td>
					<td><strong>0.5938</strong></td>
					<td>0.4963</td>
			</tr>
			<tr>
					<td>out-of-distribution</td>
					<td>0.0410</td>
					<td>0.0310</td>
					<td><strong>0.4555</strong></td>
					<td>0.2847</td>
			</tr>
			<tr>
					<td>degradation to real</td>
					<td>-34%</td>
					<td>0%</td>
					<td><strong>-23%</strong></td>
					<td>-43%</td>
			</tr>
	</tbody>
</table>
<p>With the backbone frozen, the ceiling is the representation. Fifty times more data moved a closed-form ridge ceiling by +0.020 against +0.088 predicted by a log-linear law fitted at small scale, and 54.3% of DINOv2&rsquo;s feature variance on these images is depiction style rather than molecular identity.</p>
<p>Unfreezing moves retrieval 9.6x in-distribution and 11.1x out of distribution, and the pre-registered prediction reverses: the predictive arm transfers better under a frozen backbone and the contrastive arm wins outright once the backbone can move.</p>
<h2 id="features">Features</h2>
<ul>
<li><strong>Pre-registered predictions</strong>, committed before any training run and quoted verbatim in the results with how each came out. One was wrong outright and one held then reversed.</li>
<li><strong>Four harness gates</strong> run before any headline number is believed: an oracle retrieval control, MIST against Tanimoto similarity, a random-embedding control, and a trivial image-statistics floor.</li>
<li><strong>Seven linear-probe points</strong> across five MoleculeNet datasets, on Bemis-Murcko scaffold splits committed as build artifacts so a probe number is comparable across clones.</li>
<li><strong>An out-of-distribution slice</strong> of real literature depictions, deduplicated against every training set by InChIKey with a positive control confirming the check detects injected leakage.</li>
<li><strong>Open weights and data</strong>, with an export path that verifies the published weights are the same function of pixels as the checkpoint they came from.</li>
</ul>
<h2 id="usage">Usage</h2>
<p>The released weights need <code>timm</code> and <code>torch</code>, and nothing from this repository:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-python" data-lang="python"><span style="display:flex;"><span><span style="color:#f92672">import</span> timm<span style="color:#f92672">,</span> torch
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>backbone <span style="color:#f92672">=</span> timm<span style="color:#f92672">.</span>create_model(
</span></span><span style="display:flex;"><span>    <span style="color:#e6db74">&#34;vit_small_patch14_reg4_dinov2.lvd142m&#34;</span>, pretrained<span style="color:#f92672">=</span><span style="color:#66d9ef">False</span>, num_classes<span style="color:#f92672">=</span><span style="color:#ae81ff">0</span>, img_size<span style="color:#f92672">=</span><span style="color:#ae81ff">224</span>
</span></span><span style="display:flex;"><span>)
</span></span><span style="display:flex;"><span>backbone<span style="color:#f92672">.</span>load_state_dict(torch<span style="color:#f92672">.</span>load(<span style="color:#e6db74">&#34;backbone.pt&#34;</span>, weights_only<span style="color:#f92672">=</span><span style="color:#66d9ef">True</span>))
</span></span><span style="display:flex;"><span>head <span style="color:#f92672">=</span> torch<span style="color:#f92672">.</span>nn<span style="color:#f92672">.</span>Linear(<span style="color:#ae81ff">384</span>, <span style="color:#ae81ff">512</span>)
</span></span><span style="display:flex;"><span>head<span style="color:#f92672">.</span>load_state_dict(torch<span style="color:#f92672">.</span>load(<span style="color:#e6db74">&#34;projection_head.pt&#34;</span>, weights_only<span style="color:#f92672">=</span><span style="color:#66d9ef">True</span>))
</span></span><span style="display:flex;"><span>backbone<span style="color:#f92672">.</span>eval(); head<span style="color:#f92672">.</span>eval()
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">with</span> torch<span style="color:#f92672">.</span>no_grad():
</span></span><span style="display:flex;"><span>    embedding <span style="color:#f92672">=</span> head(backbone(pixels))   <span style="color:#75715e"># (batch, 512), in MIST space</span>
</span></span></code></pre></div><p>Comparing images to each other works with the above alone. Comparing an image to a molecule additionally needs MIST to embed that molecule.</p>
<p>Weights are on Hugging Face as <a href="https://huggingface.co/hheiden/dinov2-mist-molecular-depiction-contrastive">contrastive</a> and <a href="https://huggingface.co/hheiden/dinov2-mist-molecular-depiction-predictive">predictive</a>, and the <a href="https://huggingface.co/datasets/hheiden/molecular-depiction-pairs-20k">20K depiction set</a> is published so the comparison can be re-run without the rendering environment.</p>
<h2 id="retrospective">Retrospective</h2>
<p>Scoped to a couple of weekends, and complete rather than paused. There is no roadmap.</p>
<p>The parts worth keeping are methodological. A metric defect scored a working model at the pre-registered clean-negative floor with every exit criterion passing, and it was caught by asking what a perfect model would score rather than by a test. The arm-neutral checkpoint selection rule, chosen because it is the one scalar both arms are measured by, selected epoch 1 of 24 for the contrastive arm at a cost of 2.6x on in-distribution retrieval. That was reported rather than fixed, since changing a pre-registered rule after seeing results is what pre-registration exists to prevent.</p>
<p>Every v2 number is one seed. The only repeats in the project are a five-seed frozen sweep, and the retrieval orderings clear that noise floor by roughly two orders of magnitude while individual probe cells do not.</p>
<p>The code is Apache-2.0. The released weights carry research-only terms mirroring MIST&rsquo;s, since they were trained to predict its embeddings.</p>
]]></content:encoded></item><item><title>Where to Cut, How Deep: BPE and Unigram-LM on SMILES</title><link>https://hunterheidenreich.com/research/bpe-unigram-lm-smiles-vocabularies/</link><pubDate>Wed, 08 Jul 2026 00:00:00 +0000</pubDate><guid>https://hunterheidenreich.com/research/bpe-unigram-lm-smiles-vocabularies/</guid><description>A controlled comparison showing BPE and Unigram-LM build near-disjoint subword vocabularies over chemistry SMILES, so the tokenizer is a modeling decision.</description><content:encoded><![CDATA[<p><a href="https://arxiv.org/abs/2607.05691"><strong>Where to cut, how deep</strong></a> is a controlled comparison of the two dominant subword tokenizers, byte-pair encoding (BPE) and Unigram-LM, over chemistry SMILES. Holding the corpus, the OpenSMILES glyph base, and the target vocabulary size fixed, the study asks whether the two algorithms learn the same vocabulary. They do not: across every matched condition they build near-disjoint sets of multi-glyph pieces, the same atoms carved into almost none of the same subwords.</p>
<h3 id="abstract">Abstract</h3>
<p>Every chemical language model reading SMILES begins with a tokenizer, yet the field has inherited byte-pair encoding (BPE) from natural language with little scrutiny. In natural language, BPE&rsquo;s principal alternative, Unigram-LM, is known to build structurally different vocabularies. Whether that contrast survives in chemistry was open: the complete glyph base already covers every conformant molecule, so the learned pieces add compression rather than coverage, and a tiny alphabet under hard valence constraints could drive two frequency-based algorithms to converge. We report a controlled comparison of BPE and Unigram-LM over a fixed 165-token chemistry base, at the small vocabulary sizes where token embeddings are learnable, across three corpus typologies (diverse, drug-like, natural-products) and both pre-tokenization boundary policies. The two do not converge. In all 22 matched conditions they build <em>near-disjoint</em> subword vocabularies: cross-algorithm Jaccard overlap on the learned pieces above the shared base never exceeds $0.161$, and at most $0.05$ once weighted toward the high-frequency pieces a model updates most. Unigram-LM also segments held-out molecules into $29$&ndash;$41%$ more tokens; the arms largely agree on <em>where</em> to cut but not <em>how deeply</em>, so BPE&rsquo;s segmentation is a strict coarsening of Unigram-LM&rsquo;s on $80$&ndash;$99%$ of molecules. The separation holds across corpus, boundary, and vocabulary size, persisting even at eight times that scale, past where embeddings remain learnable; only token-frequency imbalance attenuates in magnitude, shrinking with vocabulary size and most on the natural-products corpus, without closing. The subword algorithm is therefore a modeling decision, not a free default. We release all trained tokenizers and per-condition measurements.</p>
<h3 id="key-contributions--results">Key Contributions &amp; Results</h3>
<ul>
<li><strong>Near-disjoint vocabularies.</strong> Across all 22 matched conditions, cross-algorithm Jaccard overlap on the learned multi-glyph pieces never exceeds $0.161$, and drops to at most $0.05$ once weighted toward the high-frequency pieces a model updates most. The two algorithms share the glyph base and almost none of the subwords built on top of it.</li>
<li><strong>Same cuts, different depth.</strong> Unigram-LM segments held-out molecules into $29$&ndash;$41%$ more tokens. The two arms largely agree on <em>where</em> to cut but disagree on <em>how deeply</em>, so BPE&rsquo;s segmentation is a strict coarsening of Unigram-LM&rsquo;s on $80$&ndash;$99%$ of molecules. The disagreement is nesting, not conflict.</li>
<li><strong>The separation is structural.</strong> It holds across corpus typology, boundary policy, and vocabulary size, persisting even at $8\times$ the headline vocabulary, past the regime where token embeddings remain learnable. Only token-frequency imbalance attenuates in magnitude (shrinking with vocabulary size, most on the natural-products corpus) without closing.</li>
<li><strong>No language models trained.</strong> Every result is a property of the tokenizers and the corpora, so the comparison is exactly controlled. The claim is about vocabularies, not downstream task scores.</li>
<li><strong>Released artifacts.</strong> All trained tokenizers and per-condition measurements are archived for re-analysis on Zenodo.</li>
</ul>
<h3 id="study-design">Study Design</h3>
<ul>
<li><strong>Controlled grid.</strong> The comparison fixes a 165-token OpenSMILES glyph base, then trains BPE and Unigram-LM to matched target vocabulary sizes at the small scales where token embeddings stay learnable. Corpus, glyph base, and target size are held constant so any divergence is attributable to the algorithm.</li>
<li><strong>Three corpus typologies.</strong> Diverse, drug-like, and natural-products corpora span the chemistry a SMILES tokenizer is likely to meet, testing whether the divergence is a property of one chemical distribution or of the algorithms themselves.</li>
<li><strong>Both boundary policies.</strong> The grid runs under both pre-tokenization boundary policies, separating the effect of the subword algorithm from the effect of where pre-tokenization allows pieces to form.</li>
<li><strong>Mechanism diagnostics.</strong> The study reports chemistry-side measurements, previously unreported for SMILES, of three mechanism diagnostics carried from the natural-language literature (dead-zone surplus, scaffold fraction, and whole-pretoken absorption), alongside a structural-character and non-canonicity battery that localizes where the two arms diverge.</li>
</ul>
<h3 id="interactive-demo">Interactive Demo</h3>
<p>The <a href="https://huggingface.co/spaces/hheiden/smiles-subword-vocabularies">live demo</a> takes any molecule, aligns both algorithms on the shared glyph stream, and surfaces the paper&rsquo;s three contrasts directly: membership (near-disjoint vocabularies), granularity (Unigram-LM stays near-atomic and emits more tokens), and compatibility (the disagreement is nesting, so BPE&rsquo;s parse is usually a coarsening of Unigram-LM&rsquo;s). It runs on free CPU: the tokenizers are re-implemented in pure Python and validated byte-faithful against the reference Smirk tokenizer.</p>















<figure class="post-figure center ">
    <img src="/img/smiles-subword-vocabularies-cover.webp"
         alt="Nicotine and serotonin under the two algorithms&#39; V=1024 vocabularies, with BPE building larger pieces and Unigram-LM emitting more, smaller ones"
         title="Nicotine and serotonin under the two algorithms&#39; V=1024 vocabularies, with BPE building larger pieces and Unigram-LM emitting more, smaller ones"
         
         
         loading="lazy"
         class="post-image">
    
    <figcaption class="post-caption">Nicotine and serotonin under the two algorithms&rsquo; V=1024 vocabularies. Darker shading marks a larger piece. BPE (blue) builds a few large pieces spanning whole rings and chains; Unigram-LM (orange) stays near-atomic and emits more tokens per molecule (+5 and +7 here).</figcaption>
    
</figure>

<h3 id="why-this-matters">Why This Matters</h3>
<p>Chemical language models inherit BPE from natural language as an unexamined default. This study shows that the choice of subword algorithm changes the learned vocabulary itself, not merely the compression ratio: BPE and Unigram-LM hand a model different pieces to embed and different segment counts to attend over. That makes the tokenizer a modeling decision to be reported and controlled, the same way an architecture or an objective is, rather than a free default carried over without scrutiny. The released tokenizers and per-condition measurements let others re-analyze the comparison or extend it to downstream training.</p>
<h3 id="resources">Resources</h3>
<ul>
<li><a href="https://arxiv.org/abs/2607.05691"><strong>Paper (arXiv)</strong></a>: Full technical report, also on <a href="https://doi.org/10.26434/chemrxiv.15005925/v1">ChemRxiv</a>.</li>
<li><a href="https://github.com/hunter-heidenreich/smiles-subword-vocabularies"><strong>Code (GitHub)</strong></a>: The measurement and pipeline package, reproducible from SHA-pinned corpora.</li>
<li><a href="https://huggingface.co/spaces/hheiden/smiles-subword-vocabularies"><strong>Interactive Demo</strong></a>: See both tokenizers carve up any molecule, in-browser.</li>
<li><a href="https://doi.org/10.5281/zenodo.21228245"><strong>Artifacts (Zenodo)</strong></a>: Trained tokenizers and full measurement deposits.</li>
</ul>
<h3 id="citation">Citation</h3>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-bibtex" data-lang="bibtex"><span style="display:flex;"><span><span style="color:#a6e22e">@misc</span>{heidenreich2026neardisjoint,
</span></span><span style="display:flex;"><span>  <span style="color:#a6e22e">title</span>        = <span style="color:#e6db74">{{Where to cut, how deep: BPE and Unigram-LM on chemistry SMILES}}</span>,
</span></span><span style="display:flex;"><span>  <span style="color:#a6e22e">author</span>       = <span style="color:#e6db74">{Heidenreich, Hunter}</span>,
</span></span><span style="display:flex;"><span>  <span style="color:#a6e22e">year</span>         = <span style="color:#e6db74">{2026}</span>,
</span></span><span style="display:flex;"><span>  <span style="color:#a6e22e">eprint</span>       = <span style="color:#e6db74">{2607.05691}</span>,
</span></span><span style="display:flex;"><span>  <span style="color:#a6e22e">archivePrefix</span> = <span style="color:#e6db74">{arXiv}</span>,
</span></span><span style="display:flex;"><span>  <span style="color:#a6e22e">primaryClass</span> = <span style="color:#e6db74">{cs.CL}</span>,
</span></span><span style="display:flex;"><span>  <span style="color:#a6e22e">url</span>          = <span style="color:#e6db74">{https://arxiv.org/abs/2607.05691}</span>
</span></span><span style="display:flex;"><span>}
</span></span></code></pre></div><h3 id="related-work">Related Work</h3>
<ul>
<li><a href="/research/deconstructing-recurrence-attention-gating/"><strong>Deconstructing Recurrence, Attention, and Gating</strong></a>: Related work isolating a single modeling choice under controlled conditions.</li>
</ul>
]]></content:encoded></item><item><title>Benchmarking Eight OCSR Tools on Patent Images (2024)</title><link>https://hunterheidenreich.com/notes/chemistry/optical-structure-recognition/benchmarks/krasnov-ocsr-benchmark-2024/</link><pubDate>Fri, 19 Dec 2025 00:00:00 +0000</pubDate><guid>https://hunterheidenreich.com/notes/chemistry/optical-structure-recognition/benchmarks/krasnov-ocsr-benchmark-2024/</guid><description>Benchmark of 8 open-access OCSR methods on 2702 manually curated patent images, with ChemIC classifier for hybrid approach.</description><content:encoded><![CDATA[<h2 id="contribution-benchmarking-general-and-specialized-ocsr-tools">Contribution: Benchmarking General and Specialized OCSR Tools</h2>
<p>This paper is primarily a <strong>Resource</strong> contribution ($0.7 \Psi_{\text{Resource}}$) with a secondary <strong>Method</strong> component ($0.3 \Psi_{\text{Method}}$).</p>
<p>It establishes a new, independent benchmark dataset of 2,702 manually selected patent images to evaluate existing Optical Chemical Structure Recognition (OCSR) tools. The authors rigorously compare 8 different methods using this dataset to determine the state-of-the-art. The Resource contribution is evidenced by the creation of this curated benchmark, explicit evaluation metrics (exact connectivity table matching), and public release of datasets, processing scripts, and evaluation tools on Zenodo.</p>
<p>The secondary Method contribution comes through the development of &ldquo;ChemIC,&rdquo; a ResNet-50 image classifier designed to categorize images (Single vs. Multiple vs. Reaction) to enable a modular processing pipeline. However, this method serves to support the insights gained from the benchmarking resource.</p>
<h2 id="motivation-the-need-for-realistic-modality-diverse-patent-benchmarks">Motivation: The Need for Realistic, Modality-Diverse Patent Benchmarks</h2>
<p><strong>Lack of Standardization</strong>: A universally accepted standard set of images for OCSR quality measurement is currently missing; existing tools are often evaluated on synthetic data or limited datasets.</p>
<p><strong>Industrial Relevance</strong>: Patents contain diverse and &ldquo;noisy&rdquo; image modalities (Markush structures, salts, reactions, hand-drawn styles) that are critical for Freedom to Operate (FTO) and novelty checks in the pharmaceutical industry. These real-world complexities are often missing from existing benchmarks.</p>
<p><strong>Modality Gaps</strong>: Different tools excel at different tasks (e.g., single molecules vs. reactions). Monolithic approaches frequently break down on complex patent documents, and there was minimal systematic understanding of which tools perform best for which image types.</p>
<p><strong>Integration Needs</strong>: The authors aimed to identify tools to replace or augment their existing rule-based system (OSRA) within the SciWalker application, requiring a rigorous comparative study.</p>
<h2 id="core-innovation-a-curated-multi-modality-dataset-and-hybrid-classification-pipeline">Core Innovation: A Curated Multi-Modality Dataset and Hybrid Classification Pipeline</h2>
<p><strong>Independent Benchmark</strong>: Creation of a manually curated test set of 2,702 images from real-world patents (WO, EP, US), specifically selected to include &ldquo;problematic&rdquo; edge cases like inorganic complexes, peptides, and Markush structures, providing a more realistic evaluation environment than synthetic datasets.</p>
<p><strong>Comprehensive Comparison</strong>: Side-by-side evaluation of 8 open-access tools: DECIMER, ReactionDataExtractor, MolScribe, RxnScribe, SwinOCSR, OCMR, MolVec, and OSRA, using identical test conditions and evaluation criteria.</p>
<p><strong>ChemIC Classifier</strong>: Implementation of a specialized image classifier (ResNet-50) to distinguish between single molecules, multiple molecules, reactions, and non-chemical images, facilitating a &ldquo;hybrid&rdquo; pipeline that routes images to the most appropriate tool.</p>
<p><strong>Strict Evaluation Logic</strong>: Utilization of an exact match criterion for connectivity tables (ignoring partial similarity scores like Tanimoto) to reflect rigorous industrial requirements for novelty checking in patent applications.</p>
<h2 id="methodology-exact-match-evaluation-across-eight-open-source-systems">Methodology: Exact-Match Evaluation Across Eight Open-Source Systems</h2>
<p><strong>Tool Selection</strong>: Installed and tested 8 tools: DECIMER v2.4.0, ReactionDataExtractor v2.0.0, MolScribe v1.1.1, RxnScribe v1.0, MolVec v0.9.8, OCMR, SwinOCSR, and OSRA v2.1.5.</p>
<p><strong>Dataset Construction</strong>:</p>
<ul>
<li><strong>Test Set</strong>: 2,702 patent images split into three &ldquo;buckets&rdquo;: A (Single structure - 1,454 images), B (Multiple structures - 661 images), C (Reactions - 481 images).</li>
<li><strong>Training Set (for ChemIC)</strong>: 16,000 images from various sources (Patents, Im2Latex, etc.) split into 12,804 training, 1,604 validation, and 1,604 test images.</li>
</ul>
<p><strong>Evaluation Protocol</strong>:</p>
<ul>
<li>Calculated Precision, Recall, and F1 scores based on an <em>exact connectivity table structure matching</em> (rejecting Tanimoto similarity as industrially insufficient). The metrics follow standard formulations where true positives ($\text{TP}$) represent perfectly assembled structures:
$$ \text{Precision} = \frac{\text{TP}}{\text{TP} + \text{FP}} \qquad \text{Recall} = \frac{\text{TP}}{\text{TP} + \text{FN}} \qquad \text{F1} = 2 \cdot \frac{\text{Precision} \cdot \text{Recall}}{\text{Precision} + \text{Recall}} $$</li>
<li>Manual inspection by four chemists to verify predictions.</li>
<li>Developed custom tools (<code>ImageComparator</code> and <code>ExcelConstructor</code>) to facilitate visual comparison and result aggregation.</li>
</ul>
<p><strong>Segmentation Test</strong>: Applied DECIMER segmentation to multi-structure images to see if splitting them before processing improved results, combining segmentation with MolScribe for final predictions.</p>
<h2 id="key-findings-modality-specialization-outperforms-monolithic-approaches">Key Findings: Modality Specialization Outperforms Monolithic Approaches</h2>
<p><strong>Single Molecules</strong>: <strong>MolScribe</strong> achieved the highest performance (Precision: 87%, F1: 93%), followed closely by <strong>DECIMER</strong> (Precision: 84%, F1: 91%). These transformer-based approaches outperformed rule-based methods on single-structure images (e.g., MolScribe F1: 93% vs. OSRA F1: 78%).</p>
<p><strong>Reactions</strong>: Evaluated on 103 randomly selected reaction images containing 284 total reactions, <strong>RxnScribe</strong> outperformed others (Recall: 97%, F1: 86%), demonstrating the value of specialized architectures for reaction diagrams. General-purpose tools struggled with reaction recognition.</p>
<p><strong>Multiple Structures</strong>: Evaluated on 20 multi-structure images containing 146 single structures, all AI-based tools struggled. <strong>OSRA</strong> (rule-based) performed best here but still had low precision (58%). Combining DECIMER segmentation (with the <code>expand</code> option) with MolScribe on these same 20 images improved precision to 82% and F1 to 90%, showing that image segmentation as a preprocessing step can boost multi-structure performance.</p>
<p><strong>Failures</strong>: Current tools fail on polymers, large oligomers, and complex Markush structures. Most tools (except MolVec) correctly recognize cis-trans and tetrahedral stereochemistry, but other forms (e.g., octahedral, axial, helical) are not recognized. None of the evaluated tools can reliably recognize dative/coordinate bonds in metal complexes, indicating gaps in training data coverage.</p>
<p><strong>Classifier Utility</strong>: The ChemIC model achieved 99.62% accuracy on the test set, validating the feasibility of a modular pipeline where images are routed to the specific tool best suited for that modality. The authors estimate that a hybrid system (MolScribe + OSRA + RxnScribe) routed by ChemIC would achieve an average F1 of 80%, compared to 68% for OSRA alone across all modalities.</p>
<hr>
<h2 id="reproducibility-details">Reproducibility Details</h2>
<h3 id="data">Data</h3>
<table>
	<thead>
			<tr>
					<th>Purpose</th>
					<th>Dataset</th>
					<th>Size</th>
					<th>Description</th>
			</tr>
	</thead>
	<tbody>
			<tr>
					<td><strong>Benchmark (Test)</strong></td>
					<td>Manual Patent Selection</td>
					<td>2,702 Images</td>
					<td>Sources: WO, EP, US patents<br><strong>Bucket A</strong>: Single structures (1,454)<br><strong>Bucket B</strong>: Multi-structures (661)<br><strong>Bucket C</strong>: Reactions (481)</td>
			</tr>
			<tr>
					<td><strong>ChemIC Training</strong></td>
					<td>Aggregated Sources</td>
					<td>16,000 Images</td>
					<td>Sources: Patents (OntoChem), MolScribe dataset, DECIMER dataset, RxnScribe dataset, Im2Latex-100k<br><strong>Split</strong>: 12,804 Train / 1,604 Val / 1,604 Test</td>
			</tr>
	</tbody>
</table>
<h3 id="algorithms">Algorithms</h3>
<p><strong>Scoring Logic</strong>:</p>
<ul>
<li><strong>Single Molecules</strong>: Score = 1 if exact match of connectivity table (all atoms, valencies, bonds, superatom abbreviations, and charge correct), 0 otherwise. Stereochemistry correctness was not considered a scoring criterion. Tanimoto similarity explicitly rejected as too lenient.</li>
<li><strong>Reactions</strong>: Considered correct if at least one reactant and one product are correct and capture main features. Stoichiometry and conditions ignored.</li>
</ul>
<p><strong>Image Segmentation</strong>: Used DECIMER segmentation (with <code>expand</code> option) to split multi-structure images into single images before passing to MolScribe.</p>
<h3 id="models">Models</h3>
<table>
	<thead>
			<tr>
					<th>Tool</th>
					<th>Version</th>
					<th>Architecture</th>
			</tr>
	</thead>
	<tbody>
			<tr>
					<td><strong>DECIMER</strong></td>
					<td>v2.4.0</td>
					<td>EfficientNet-V2-M encoder + Transformer decoder</td>
			</tr>
			<tr>
					<td><strong>MolScribe</strong></td>
					<td>v1.1.1</td>
					<td>Swin Transformer encoder + Transformer decoder</td>
			</tr>
			<tr>
					<td><strong>RxnScribe</strong></td>
					<td>v1.0</td>
					<td>Specialized for reaction diagrams</td>
			</tr>
			<tr>
					<td><strong>ReactionDataExtractor</strong></td>
					<td>v2.0.0</td>
					<td>Deep learning-based extraction</td>
			</tr>
			<tr>
					<td><strong>MolVec</strong></td>
					<td>v0.9.8</td>
					<td>Rule-based vectorization</td>
			</tr>
			<tr>
					<td><strong>OSRA</strong></td>
					<td>v2.1.5</td>
					<td>Rule-based recognition</td>
			</tr>
			<tr>
					<td><strong>SwinOCSR</strong></td>
					<td>-</td>
					<td>Swin Transformer encoder-decoder</td>
			</tr>
			<tr>
					<td><strong>OCMR</strong></td>
					<td>-</td>
					<td>CNN-based framework</td>
			</tr>
			<tr>
					<td><strong>ChemIC (New)</strong></td>
					<td>-</td>
					<td>ResNet-50 CNN in PyTorch for 4-class classification</td>
			</tr>
	</tbody>
</table>
<h3 id="evaluation">Evaluation</h3>
<p><strong>Key Results on Single Structures (Bucket A - 400 random sample):</strong></p>
<table>
	<thead>
			<tr>
					<th>Method</th>
					<th>Precision</th>
					<th>Recall</th>
					<th>F1 Score</th>
			</tr>
	</thead>
	<tbody>
			<tr>
					<td><strong>MolScribe</strong></td>
					<td>87%</td>
					<td>100%</td>
					<td>93%</td>
			</tr>
			<tr>
					<td><strong>DECIMER</strong></td>
					<td>84%</td>
					<td>100%</td>
					<td>91%</td>
			</tr>
			<tr>
					<td><strong>OCMR</strong></td>
					<td>77%</td>
					<td>100%</td>
					<td>87%</td>
			</tr>
			<tr>
					<td><strong>MolVec</strong></td>
					<td>74%</td>
					<td>100%</td>
					<td>85%</td>
			</tr>
			<tr>
					<td><strong>OSRA</strong></td>
					<td>64%</td>
					<td>100%</td>
					<td>78%</td>
			</tr>
			<tr>
					<td><strong>SwinOCSR</strong></td>
					<td>65%</td>
					<td>95%</td>
					<td>77%</td>
			</tr>
	</tbody>
</table>
<p><strong>Key Results on Reactions (Bucket C):</strong></p>
<table>
	<thead>
			<tr>
					<th>Method</th>
					<th>Precision</th>
					<th>Recall</th>
					<th>F1 Score</th>
			</tr>
	</thead>
	<tbody>
			<tr>
					<td><strong>RxnScribe</strong></td>
					<td>77%</td>
					<td>97%</td>
					<td>86%</td>
			</tr>
			<tr>
					<td><strong>OSRA</strong></td>
					<td>64%</td>
					<td>65%</td>
					<td>64%</td>
			</tr>
			<tr>
					<td><strong>ReactionDataExtractor</strong></td>
					<td>49%</td>
					<td>62%</td>
					<td>55%</td>
			</tr>
	</tbody>
</table>
<h3 id="hardware">Hardware</h3>
<p><strong>ChemIC Training</strong>: Trained on a machine with 40 Intel(R) Xeon(R) Gold 6226 CPUs. Training time approximately 6 hours for 100 epochs (early stopping at epoch 26).</p>
<h3 id="artifacts">Artifacts</h3>
<table>
	<thead>
			<tr>
					<th>Artifact</th>
					<th>Type</th>
					<th>License</th>
					<th>Notes</th>
			</tr>
	</thead>
	<tbody>
			<tr>
					<td><a href="https://doi.org/10.5281/zenodo.10546827">Zenodo Repository (Code &amp; Data)</a></td>
					<td>Code, Dataset</td>
					<td>Unknown</td>
					<td>Benchmark images, processing scripts, evaluation tools, ChemIC classifier code</td>
			</tr>
			<tr>
					<td><a href="https://github.com/ontochem/ImageComparator">ImageComparator</a></td>
					<td>Code</td>
					<td>MIT</td>
					<td>Java tool for visual comparison of OCSR predictions</td>
			</tr>
	</tbody>
</table>
<hr>
<h2 id="paper-information">Paper Information</h2>
<p><strong>Citation</strong>: Krasnov, A., Barnabas, S. J., Boehme, T., Boyer, S. K., &amp; Weber, L. (2024). Comparing software tools for optical chemical structure recognition. <em>Digital Discovery</em>, 3(4), 681-693. <a href="https://doi.org/10.1039/D3DD00228D">https://doi.org/10.1039/D3DD00228D</a></p>
<p><strong>Publication</strong>: Digital Discovery 2024</p>
<p><strong>Additional Resources</strong>:</p>
<ul>
<li><a href="https://doi.org/10.5281/zenodo.10546827">Zenodo Repository (Code &amp; Data)</a></li>
</ul>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-bibtex" data-lang="bibtex"><span style="display:flex;"><span><span style="color:#a6e22e">@article</span>{krasnovComparingSoftwareTools2024,
</span></span><span style="display:flex;"><span>  <span style="color:#a6e22e">title</span> = <span style="color:#e6db74">{Comparing Software Tools for Optical Chemical Structure Recognition}</span>,
</span></span><span style="display:flex;"><span>  <span style="color:#a6e22e">author</span> = <span style="color:#e6db74">{Krasnov, Aleksei and Barnabas, Shadrack J. and Boehme, Timo and Boyer, Stephen K. and Weber, Lutz}</span>,
</span></span><span style="display:flex;"><span>  <span style="color:#a6e22e">year</span> = <span style="color:#e6db74">{2024}</span>,
</span></span><span style="display:flex;"><span>  <span style="color:#a6e22e">journal</span> = <span style="color:#e6db74">{Digital Discovery}</span>,
</span></span><span style="display:flex;"><span>  <span style="color:#a6e22e">volume</span> = <span style="color:#e6db74">{3}</span>,
</span></span><span style="display:flex;"><span>  <span style="color:#a6e22e">number</span> = <span style="color:#e6db74">{4}</span>,
</span></span><span style="display:flex;"><span>  <span style="color:#a6e22e">pages</span> = <span style="color:#e6db74">{681--693}</span>,
</span></span><span style="display:flex;"><span>  <span style="color:#a6e22e">publisher</span> = <span style="color:#e6db74">{Royal Society of Chemistry}</span>,
</span></span><span style="display:flex;"><span>  <span style="color:#a6e22e">doi</span> = <span style="color:#e6db74">{10.1039/D3DD00228D}</span>,
</span></span><span style="display:flex;"><span>  <span style="color:#a6e22e">langid</span> = <span style="color:#e6db74">{english}</span>
</span></span><span style="display:flex;"><span>}
</span></span></code></pre></div>]]></content:encoded></item><item><title>Review of OCSR Techniques and Models (Musazade 2022)</title><link>https://hunterheidenreich.com/notes/chemistry/optical-structure-recognition/benchmarks/musazade-ocsr-review-2022/</link><pubDate>Thu, 18 Dec 2025 00:00:00 +0000</pubDate><guid>https://hunterheidenreich.com/notes/chemistry/optical-structure-recognition/benchmarks/musazade-ocsr-review-2022/</guid><description>Systematization of OCSR evolution from rule-based systems to deep learning, highlighting the paradigm shift to image captioning approaches.</description><content:encoded><![CDATA[<h2 id="systematization-of-ocsr-evolution">Systematization of OCSR Evolution</h2>
<p>This is a <strong>Systematization</strong> paper ($\Psi_{\text{Systematization}}$). It organizes existing literature into two distinct evolutionary phases: <strong>Rule-based systems</strong> (1990s-2010s) and <strong>Machine Learning-based systems</strong> (2015-present). It synthesizes performance metrics across these paradigms to highlight the shift from simple classification to &ldquo;image captioning&rdquo; (sequence generation).</p>
<p><strong>Justification</strong>: The paper focuses on &ldquo;organizing and synthesizing existing literature&rdquo; and answers the core question: &ldquo;What do we know?&rdquo; The dominant contribution is systematization based on several key indicators:</p>
<ol>
<li>
<p><strong>Survey Structure</strong>: The paper explicitly structures content by categorizing the field into two distinct historical and methodological groups: &ldquo;Rule-based systems&rdquo; and &ldquo;ML-based systems&rdquo;. It traces the &ldquo;evolution of approaches from rule-based structure analyses to complex statistical models&rdquo;, moving chronologically from early tools like OROCS and OSRA (1990s-2000s) to modern Deep Learning approaches like DECIMER and Vision Transformers.</p>
</li>
<li>
<p><strong>Synthesis of Knowledge</strong>: The paper aggregates performance metrics from various distinct studies into unified comparison tables (Table 1 for rule-based and Table 2 for ML-based). It synthesizes technical details of different models, explaining how specific architectures (CNNs, LSTMs, Attention mechanisms) are applied to the specific problem of Optical Chemical Structure Recognition (OCSR).</p>
</li>
<li>
<p><strong>Identification of Gaps</strong>: The authors dedicate specific sections to &ldquo;Gaps of rule-based systems&rdquo; and &ldquo;Gaps of ML-based systems&rdquo;. It concludes with recommendations for future development, such as the need for &ldquo;standardized datasets&rdquo; and specific improvements in image augmentation and evaluation metrics.</p>
</li>
</ol>
<h2 id="motivation-for-digitization-in-cheminformatics">Motivation for Digitization in Cheminformatics</h2>
<p>The primary motivation is the need to digitize vast amounts of chemical knowledge locked in non-digital formats (e.g., scanned PDFs, older textbooks). This is challenging because:</p>
<ol>
<li><strong>Representational Variety</strong>: A single chemical formula can be drawn in many visually distinct ways (e.g., different orientations, bond styles, fonts).</li>
<li><strong>Legacy Data</strong>: Older documents contain noise, low resolution, and disconnected strokes that confuse standard computer vision models.</li>
<li><strong>Lack of Standardization</strong>: There is no centralized database or standardized benchmark for evaluating OCSR performance, making comparison difficult.</li>
</ol>
<h2 id="key-insights-and-the-paradigm-shift">Key Insights and the Paradigm Shift</h2>
<p>The paper provides a structured comparison of the &ldquo;evolution&rdquo; of OCSR, specifically identifying the pivot point where the field moved from object detection to <strong>NLP-inspired sequence generation</strong>.</p>
<p>Key insights include:</p>
<ul>
<li><strong>The Paradigm Shift</strong>: Identifying that OCSR has effectively become an &ldquo;image captioning&rdquo; problem where the &ldquo;caption&rdquo; is a <a href="/notes/chemistry/molecular-representations/notations/smiles/">SMILES</a> or <a href="/notes/chemistry/molecular-representations/notations/inchi-2013/">InChI</a> string.</li>
<li><strong>Metric Critique</strong>: It critically analyzes the flaws in current evaluation metrics, noting that Levenshtein Distance (LD) is better than simple accuracy but still fails to capture semantic chemical severity (e.g., mistaking &ldquo;F&rdquo; for &ldquo;S&rdquo; is worse than a wrong digit).</li>
<li><strong>Hybrid Potential</strong>: Despite the dominance of ML, the authors argue that rule-based heuristics are still valuable for post-processing validation (e.g., checking element order, sequence structure, and formula correspondence).</li>
</ul>
<h2 id="comparative-analysis-of-rule-based-vs-ml-systems">Comparative Analysis of Rule-Based vs. ML Systems</h2>
<p>As a review paper, it aggregates experimental results from primary sources. It compares:</p>
<ul>
<li><strong>Rule-based systems</strong>: OSRA, chemoCR, Imago, Markov Logic OCSR, and various heuristic approaches.</li>
<li><strong>ML-based systems</strong>: DECIMER (multiple versions), MSE-DUDL, ICMDT (Image Captioning Model based on Deep Transformer-in-Transformer), and other BMS Kaggle competition solutions.</li>
</ul>
<p>It contrasts these systems using:</p>
<ul>
<li><strong>Datasets</strong>: BMS (synthetic, 4M images), PubChem (synthetic), U.S. Patents (real-world scanned).</li>
<li><strong>Metrics</strong>: Tanimoto similarity (structural overlap) and Levenshtein distance (string edit distance).</li>
</ul>
<h2 id="outcomes-critical-gaps-and-recommendations">Outcomes, Critical Gaps, and Recommendations</h2>
<ol>
<li><strong>Transformers are SOTA</strong>: Attention-based encoder-decoder models outperform CNN-RNN hybrids. DECIMER 1.0 achieved 96.47% Tanimoto $= 1.0$ on its test set using an EfficientNet-B3 encoder and Transformer decoder.</li>
<li><strong>Data Hungry</strong>: Modern approaches require massive datasets (millions of images) and significant compute. DECIMER 1.0 trained on 39M images for 14 days on TPU, while the original DECIMER took 27 days on a single GPU. Rule-based systems required neither large data nor heavy compute but hit a performance ceiling.</li>
<li><strong>Critical Gaps</strong>:
<ul>
<li><strong>Super-atoms</strong>: Current models struggle with abbreviated super-atoms (e.g., &ldquo;Ph&rdquo;, &ldquo;COOH&rdquo;).</li>
<li><strong>Stereochemistry</strong>: 3D information (wedges/dashes) is often lost or misinterpreted.</li>
<li><strong>Resolution</strong>: Models are brittle to resolution changes; some require high-res, others fail if images aren&rsquo;t downscaled.</li>
</ul>
</li>
<li><strong>Recommendation</strong>: Future systems should integrate &ldquo;smart&rdquo; pre-processing (denoising without cropping) and use domain-specific distance metrics. The authors also note that post-processing formula validation (checking element order, sequence structure, and formula correspondence) increases accuracy by around 5-6% on average. They suggest exploring Capsule Networks as an alternative to CNNs, since capsules add position invariance through routing-by-agreement rather than max-pooling.</li>
</ol>
<h2 id="reproducibility">Reproducibility</h2>
<p>As a review paper, this work does not introduce original code, models, or datasets. The paper itself is open access via the Journal of Cheminformatics. This section summarizes the technical details of the systems reviewed.</p>
<h3 id="data">Data</h3>
<p>The review identifies the following key datasets used for training OCSR models:</p>
<table>
	<thead>
			<tr>
					<th style="text-align: left">Dataset</th>
					<th style="text-align: left">Type</th>
					<th style="text-align: left">Size</th>
					<th style="text-align: left">Notes</th>
			</tr>
	</thead>
	<tbody>
			<tr>
					<td style="text-align: left"><strong>BMS (Bristol-Myers Squibb)</strong></td>
					<td style="text-align: left">Synthetic</td>
					<td style="text-align: left">~4M images</td>
					<td style="text-align: left">2.4M train / 1.6M test. Used for Kaggle competition. Test images contain noise (salt &amp; pepper, blur) and rotations absent from training images.</td>
			</tr>
			<tr>
					<td style="text-align: left"><strong>PubChem</strong></td>
					<td style="text-align: left">Synthetic</td>
					<td style="text-align: left">~39M</td>
					<td style="text-align: left">Generated via CDK (Chemistry Development Kit). Used by DECIMER 1.0 (90/10 train/test split).</td>
			</tr>
			<tr>
					<td style="text-align: left"><strong>U.S. Patents (USPTO)</strong></td>
					<td style="text-align: left">Scanned</td>
					<td style="text-align: left">Variable</td>
					<td style="text-align: left">Real-world noise, often low resolution. One of several training sources for MSE-DUDL (alongside PubChem and Indigo, totaling 50M+ samples).</td>
			</tr>
			<tr>
					<td style="text-align: left"><strong>ChemInfty</strong></td>
					<td style="text-align: left">Scanned</td>
					<td style="text-align: left">869 images</td>
					<td style="text-align: left">Older benchmark used to evaluate rule-based systems (e.g., Markov Logic OCSR).</td>
			</tr>
	</tbody>
</table>
<h3 id="algorithms">Algorithms</h3>
<p>The review highlights the progression of algorithms:</p>
<ul>
<li><strong>Rule-Based</strong>: Hough transforms for bond detection, vectorization/skeletonization, and OCR for atom labels.</li>
<li><strong>Sequence Modeling</strong>:
<ul>
<li><strong>Image Captioning</strong>: Encoder (CNN/ViT) → Decoder (RNN/Transformer).</li>
<li><strong>Tokenization</strong>: Parsing InChI/SMILES into discrete tokens (e.g., splitting <code>C13</code> into <code>C</code>, <code>13</code>).</li>
<li><strong>Beam Search</strong>: Used in inference (typical $k=15-20$) to find the most likely chemical string.</li>
</ul>
</li>
</ul>
<h3 id="models">Models</h3>
<p>Key architectures reviewed:</p>
<ul>
<li><strong>DECIMER 1.0</strong>: Uses <strong>EfficientNet-B3</strong> (Encoder) and <strong>Transformer</strong> (Decoder). Predicts <a href="/notes/chemistry/molecular-representations/notations/selfies/">SELFIES</a> strings (more robust than <a href="/notes/chemistry/molecular-representations/notations/smiles/">SMILES</a>).</li>
<li><strong>Swin Transformer</strong>: Often used in Kaggle ensembles as the visual encoder due to better handling of variable image sizes.</li>
<li><strong>Grid LSTM</strong>: Used in older deep learning approaches (MSE-DUDL) to capture spatial dependencies.</li>
</ul>
<h3 id="evaluation">Evaluation</h3>
<p>Metrics standard in the field:</p>
<ul>
<li><strong>Levenshtein Distance (LD)</strong>: Edit distance between predicted and ground truth strings. Lower is better. Formally, for two sequences $a$ and $b$ (e.g. SMILES strings) of lengths $|a|$ and $|b|$, the recursive distance $LD(a, b)$ is bounded from $0$ to $\max(|a|, |b|)$.</li>
<li><strong>Tanimoto Similarity</strong>: Measures overlap of molecular fingerprints ($0.0 - 1.0$). Higher is better. DECIMER 1.0 achieved a Tanimoto of 0.99 on PubChem data (Table 2). Calculated as:
$$
\begin{aligned}
T(A, B) = \frac{N_c}{N_a + N_b - N_c}
\end{aligned}
$$
where $N_a$ and $N_b$ are the number of bits set to 1 in fingerprints $A$ and $B$, and $N_c$ is the number of common bits set to 1.</li>
<li><strong>1-1 Match Rate</strong>: Exact string matching (accuracy). For DECIMER 1.0, 96.47% of results achieved Tanimoto $= 1.0$.</li>
</ul>
<h3 id="hardware">Hardware</h3>
<ul>
<li><strong>Training Cost</strong>: High for SOTA. DECIMER 1.0 required ~14 days on TPU. The original DECIMER took ~27 days on a single NVIDIA GPU.</li>
<li><strong>Inference</strong>: Transformer models are heavy; rule-based systems run on standard CPUs but with lower accuracy.</li>
</ul>
<h2 id="paper-information">Paper Information</h2>
<p><strong>Citation</strong>: Musazade, F., Jamalova, N., &amp; Hasanov, J. (2022). Review of techniques and models used in optical chemical structure recognition in images and scanned documents. <em>Journal of Cheminformatics</em>, 14(1), 61. <a href="https://doi.org/10.1186/s13321-022-00642-3">https://doi.org/10.1186/s13321-022-00642-3</a></p>
<p><strong>Publication</strong>: Journal of Cheminformatics 2022</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-bibtex" data-lang="bibtex"><span style="display:flex;"><span><span style="color:#a6e22e">@article</span>{musazadeReviewTechniquesModels2022,
</span></span><span style="display:flex;"><span>  <span style="color:#a6e22e">title</span> = <span style="color:#e6db74">{Review of Techniques and Models Used in Optical Chemical Structure Recognition in Images and Scanned Documents}</span>,
</span></span><span style="display:flex;"><span>  <span style="color:#a6e22e">author</span> = <span style="color:#e6db74">{Musazade, Fidan and Jamalova, Narmin and Hasanov, Jamaladdin}</span>,
</span></span><span style="display:flex;"><span>  <span style="color:#a6e22e">year</span> = <span style="color:#ae81ff">2022</span>,
</span></span><span style="display:flex;"><span>  <span style="color:#a6e22e">month</span> = sep,
</span></span><span style="display:flex;"><span>  <span style="color:#a6e22e">journal</span> = <span style="color:#e6db74">{Journal of Cheminformatics}</span>,
</span></span><span style="display:flex;"><span>  <span style="color:#a6e22e">volume</span> = <span style="color:#e6db74">{14}</span>,
</span></span><span style="display:flex;"><span>  <span style="color:#a6e22e">number</span> = <span style="color:#e6db74">{1}</span>,
</span></span><span style="display:flex;"><span>  <span style="color:#a6e22e">pages</span> = <span style="color:#e6db74">{61}</span>,
</span></span><span style="display:flex;"><span>  <span style="color:#a6e22e">doi</span> = <span style="color:#e6db74">{10.1186/s13321-022-00642-3}</span>
</span></span><span style="display:flex;"><span>}
</span></span></code></pre></div>]]></content:encoded></item><item><title>A Review of Optical Chemical Structure Recognition Tools</title><link>https://hunterheidenreich.com/notes/chemistry/optical-structure-recognition/benchmarks/rajan-ocsr-review-2020/</link><pubDate>Wed, 17 Dec 2025 00:00:00 +0000</pubDate><guid>https://hunterheidenreich.com/notes/chemistry/optical-structure-recognition/benchmarks/rajan-ocsr-review-2020/</guid><description>Comprehensive review and benchmarking of 30 years of Optical Chemical Structure Recognition (OCSR) methods and tools.</description><content:encoded><![CDATA[<h2 id="systematization-and-benchmarking-of-ocsr">Systematization and Benchmarking of OCSR</h2>
<p>This is primarily a <strong>Systematization</strong> paper ($0.7 \Psi_{\text{Systematization}}$) with a significant <strong>Resource</strong> component ($0.3 \Psi_{\text{Resource}}$).</p>
<p>It serves as a <strong>Systematization</strong> because it organizes nearly three decades of research in Optical Chemical Structure Recognition (OCSR), categorizing methods into rule-based systems (e.g., Kekulé, CLiDE, OSRA) and emerging machine-learning approaches (e.g., MSE-DUDL, Chemgrapher). It synthesizes information on 16 distinct tools, many of which are commercial or no longer available.</p>
<p>It acts as a <strong>Resource</strong> by defining a benchmark for the field. The authors evaluate the three available open-source tools (Imago, MolVec, OSRA) against four distinct datasets to establish baseline performance metrics for accuracy and speed.</p>
<h2 id="motivation-digitizing-legacy-chemical-literature">Motivation: Digitizing Legacy Chemical Literature</h2>
<p>A vast amount of chemical knowledge remains &ldquo;hidden&rdquo; in the primary scientific literature (printed or PDF), conveyed as 2D images. Because these depictions are not machine-readable, there is a &ldquo;backlog of decades of chemical literature&rdquo; that cannot be easily indexed or searched in open-access databases.</p>
<p>While Chemical Named Entity Recognition (NER) exists for text, translating graphical depictions into formats like SMILES or SDfiles requires specialized OCSR tools. The motivation is to enable the automated curation of this legacy data to feed public databases.</p>
<h2 id="core-innovations-historical-taxonomy-and-open-standards">Core Innovations: Historical Taxonomy and Open Standards</h2>
<p>The primary novelty is the comprehensive aggregation of the history of the field, which had not been thoroughly reviewed recently. It details the algorithmic evolution from the first work in 1990 to deep learning methods in 2019.</p>
<p>Specific contributions include:</p>
<ul>
<li><strong>Historical Taxonomy</strong>: Classification of tools into rule-based vs. machine-learning, and open-source vs. commercial/unavailable.</li>
<li><strong>Open Source Benchmark</strong>: A comparative performance analysis of the only three open-source tools available at the time (Imago, MolVec, OSRA) on standardized datasets.</li>
<li><strong>Algorithmic Breakdown</strong>: Detailed summaries of the workflows for closed-source or lost tools (e.g., Kekulé, OROCS, ChemReader) based on their original publications.</li>
</ul>
<h2 id="benchmarking-methodology-and-open-source-evaluation">Benchmarking Methodology and Open-Source Evaluation</h2>
<p>The authors performed a benchmark study to evaluate the accuracy and speed of three open-source OCSR tools: <strong>MolVec (0.9.7)</strong>, <strong>Imago (2.0)</strong>, and <strong>OSRA (2.1.0)</strong>.</p>
<p>They tested these tools on four datasets of varying quality and origin:</p>
<ol>
<li><strong>USPTO</strong>: 5,719 images from US patents (high quality).</li>
<li><strong>UOB</strong>: 5,740 images from the University of Birmingham, published alongside MolRec.</li>
<li><strong>CLEF 2012</strong>: 961 images from the CLEF-IP evaluation (well-segmented, clean).</li>
<li><strong>JPO</strong>: 450 images from Japanese patents (low quality, noise, Japanese characters).</li>
</ol>
<p>Evaluation metrics were:</p>
<ul>
<li><strong>Accuracy</strong>: Percentage of perfectly recognized structures, mathematically defined as exact string matching between generated and reference standard InChI sequences $\text{Accuracy} = \frac{\text{Correct InChI Matches}}{\text{Total Images}}$ (verified by converting output to <a href="/notes/chemistry/molecular-representations/notations/inchi-2013/">InChI</a> strings and matching against reference InChIs).</li>
<li><strong>Speed</strong>: Total processing time for the dataset.</li>
</ul>
<h2 id="results-and-general-conclusions">Results and General Conclusions</h2>
<p><strong>Benchmark Results (Table 2)</strong>:</p>
<table>
	<thead>
			<tr>
					<th>Dataset</th>
					<th>Metric</th>
					<th>MolVec 0.9.7</th>
					<th>Imago 2.0</th>
					<th>OSRA 2.1.0</th>
			</tr>
	</thead>
	<tbody>
			<tr>
					<td>USPTO (5,719 images)</td>
					<td>Time (min)</td>
					<td>28.65</td>
					<td>72.83</td>
					<td>145.04</td>
			</tr>
			<tr>
					<td></td>
					<td>Accuracy</td>
					<td>88.41%</td>
					<td>87.20%</td>
					<td>87.69%</td>
			</tr>
			<tr>
					<td>UOB (5,740 images)</td>
					<td>Time (min)</td>
					<td>28.42</td>
					<td>152.52</td>
					<td>125.78</td>
			</tr>
			<tr>
					<td></td>
					<td>Accuracy</td>
					<td>88.39%</td>
					<td>63.54%</td>
					<td>86.50%</td>
			</tr>
			<tr>
					<td>CLEF 2012 (961 images)</td>
					<td>Time (min)</td>
					<td>4.41</td>
					<td>16.03</td>
					<td>21.33</td>
			</tr>
			<tr>
					<td></td>
					<td>Accuracy</td>
					<td>80.96%</td>
					<td>65.45%</td>
					<td>94.90%</td>
			</tr>
			<tr>
					<td>JPO (450 images)</td>
					<td>Time (min)</td>
					<td>7.50</td>
					<td>22.55</td>
					<td>16.68</td>
			</tr>
			<tr>
					<td></td>
					<td>Accuracy</td>
					<td>66.67%</td>
					<td>40.00%</td>
					<td>57.78%</td>
			</tr>
	</tbody>
</table>
<p><strong>Key Observations</strong>:</p>
<ul>
<li><strong>MolVec</strong> was the fastest tool, processing datasets significantly quicker than competitors (e.g., 28.65 min for USPTO vs. 145.04 min for OSRA).</li>
<li><strong>OSRA</strong> performed exceptionally well on clean, well-segmented data (94.90% on CLEF 2012) but was slower.</li>
<li><strong>Imago</strong> generally lagged in accuracy compared to the other two, particularly on the UOB dataset (63.54% vs. 88.39% for MolVec and 86.50% for OSRA).</li>
<li><strong>JPO Difficulty</strong>: All tools struggled with the noisy Japanese Patent Office dataset (accuracies ranged from 40.00% to 66.67%), highlighting issues with noise and non-standard labels.</li>
</ul>
<p><strong>General Conclusions</strong>:</p>
<ul>
<li>No &ldquo;gold standard&rdquo; tool existed (as of 2020) that solved all problems (page segmentation, R-groups, NLP integration).</li>
<li>Rule-based approaches dominate the history of the field, but deep learning methods (MSE-DUDL, Chemgrapher) were emerging, though they were closed-source at the time of writing.</li>
<li>There was a critical need for tools that could handle full-page recognition (combining segmentation and recognition).</li>
</ul>
<h2 id="reproducibility-details">Reproducibility Details</h2>
<p>The authors provided sufficient detail to replicate the benchmarking study.</p>
<h3 id="artifacts">Artifacts</h3>
<table>
	<thead>
			<tr>
					<th>Artifact</th>
					<th>Type</th>
					<th>License</th>
					<th>Notes</th>
			</tr>
	</thead>
	<tbody>
			<tr>
					<td><a href="https://github.com/Kohulan/OCSR_Review">OCSR_Review (GitHub)</a></td>
					<td>Code / Data</td>
					<td>MIT</td>
					<td>Benchmark images (PNG, 72 dpi) and evaluation scripts</td>
			</tr>
			<tr>
					<td><a href="https://sourceforge.net/p/osra/wiki/Download/">OSRA</a></td>
					<td>Code</td>
					<td>Open Source</td>
					<td>Version 2.1.0 tested; precompiled binaries are commercial</td>
			</tr>
			<tr>
					<td><a href="https://lifescience.opensource.epam.com/download/imago.html">Imago</a></td>
					<td>Code</td>
					<td>Open Source</td>
					<td>Version 2.0 tested; no longer actively developed</td>
			</tr>
			<tr>
					<td><a href="https://github.com/ncats/molvec">MolVec</a></td>
					<td>Code</td>
					<td>LGPL-2.1</td>
					<td>Version 0.9.7 tested; Java-based standalone tool</td>
			</tr>
	</tbody>
</table>
<h3 id="data">Data</h3>
<p>The study used four public datasets. Images were converted to PNG (72 dpi) to ensure compatibility across all tools.</p>
<table>
	<thead>
			<tr>
					<th>Dataset</th>
					<th>Size</th>
					<th>Source</th>
					<th>Characteristics</th>
			</tr>
	</thead>
	<tbody>
			<tr>
					<td><strong>USPTO</strong></td>
					<td>5,719</td>
					<td>OSRA Validation Set</td>
					<td>US Patent images, generally clean.</td>
			</tr>
			<tr>
					<td><strong>UOB</strong></td>
					<td>5,740</td>
					<td>Univ. of Birmingham</td>
					<td>Published alongside MolRec.</td>
			</tr>
			<tr>
					<td><strong>CLEF 2012</strong></td>
					<td>961</td>
					<td>CLEF-IP 2012</td>
					<td>Well-segmented, high quality.</td>
			</tr>
			<tr>
					<td><strong>JPO</strong></td>
					<td>450</td>
					<td>Japanese Patent Office</td>
					<td>Low quality, noisy, contains Japanese text.</td>
			</tr>
	</tbody>
</table>
<h3 id="algorithms">Algorithms</h3>
<p>The paper does not propose a new algorithm but benchmarks existing ones. The execution commands for reproducibility were:</p>
<ul>
<li><strong>Imago</strong>: Executed via command line without installation.
<code>./imago_console -dir /image/directory/path</code></li>
<li><strong>MolVec</strong>: Executed as a JAR file.
<code>java -cp [dependencies] gov.nih.ncats.molvec.Main -dir [input_dir] -outDir [output_dir]</code></li>
<li><strong>OSRA</strong>: Installed via Conda (PyOSRA) due to compilation complexity. Required dictionaries for superatoms and spelling.
<code>osra -f sdf -a [superatom_dict] -l [spelling_dict] -w [output_file] [input_file]</code></li>
</ul>
<h3 id="models">Models</h3>
<p>The specific versions of the open-source software tested were:</p>
<table>
	<thead>
			<tr>
					<th>Tool</th>
					<th>Version</th>
					<th>Technology</th>
					<th>License</th>
			</tr>
	</thead>
	<tbody>
			<tr>
					<td><strong>MolVec</strong></td>
					<td>0.9.7</td>
					<td>Java-based, rule-based</td>
					<td>LGPL-2.1</td>
			</tr>
			<tr>
					<td><strong>Imago</strong></td>
					<td>2.0</td>
					<td>C++, rule-based</td>
					<td>Open Source</td>
			</tr>
			<tr>
					<td><strong>OSRA</strong></td>
					<td>2.1.0</td>
					<td>C++, rule-based</td>
					<td>Open Source</td>
			</tr>
	</tbody>
</table>
<h3 id="evaluation">Evaluation</h3>
<ul>
<li><strong>Metric</strong>: Perfect structural match. The output SDfile/SMILES was converted to a Standard InChI string and compared to the ground truth InChI. Any deviation counted as a failure.</li>
<li><strong>Environment</strong>: Linux workstation (Ubuntu 20.04 LTS).</li>
</ul>
<h3 id="hardware">Hardware</h3>
<p>The benchmark was performed on a high-end workstation to measure processing time.</p>
<ul>
<li><strong>CPUs</strong>: 2x Intel Xeon Silver 4114 (40 threads total).</li>
<li><strong>RAM</strong>: 64 GB.</li>
<li><strong>Parallelization</strong>: MolVec had pre-implemented parallelization features that contributed to its speed.</li>
</ul>
<h2 id="paper-information">Paper Information</h2>
<p><strong>Citation</strong>: Rajan, K., Brinkhaus, H. O., Zielesny, A., &amp; Steinbeck, C. (2020). A review of optical chemical structure recognition tools. <em>Journal of Cheminformatics</em>, 12(1), 60. <a href="https://doi.org/10.1186/s13321-020-00465-0">https://doi.org/10.1186/s13321-020-00465-0</a></p>
<p><strong>Publication</strong>: Journal of Cheminformatics 2020</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-bibtex" data-lang="bibtex"><span style="display:flex;"><span><span style="color:#a6e22e">@article</span>{rajanReviewOpticalChemical2020,
</span></span><span style="display:flex;"><span>  <span style="color:#a6e22e">title</span> = <span style="color:#e6db74">{A Review of Optical Chemical Structure Recognition Tools}</span>,
</span></span><span style="display:flex;"><span>  <span style="color:#a6e22e">author</span> = <span style="color:#e6db74">{Rajan, Kohulan and Brinkhaus, Henning Otto and Zielesny, Achim and Steinbeck, Christoph}</span>,
</span></span><span style="display:flex;"><span>  <span style="color:#a6e22e">year</span> = <span style="color:#ae81ff">2020</span>,
</span></span><span style="display:flex;"><span>  <span style="color:#a6e22e">month</span> = oct,
</span></span><span style="display:flex;"><span>  <span style="color:#a6e22e">journal</span> = <span style="color:#e6db74">{Journal of Cheminformatics}</span>,
</span></span><span style="display:flex;"><span>  <span style="color:#a6e22e">volume</span> = <span style="color:#e6db74">{12}</span>,
</span></span><span style="display:flex;"><span>  <span style="color:#a6e22e">number</span> = <span style="color:#e6db74">{1}</span>,
</span></span><span style="display:flex;"><span>  <span style="color:#a6e22e">pages</span> = <span style="color:#e6db74">{60}</span>,
</span></span><span style="display:flex;"><span>  <span style="color:#a6e22e">issn</span> = <span style="color:#e6db74">{1758-2946}</span>,
</span></span><span style="display:flex;"><span>  <span style="color:#a6e22e">doi</span> = <span style="color:#e6db74">{10.1186/s13321-020-00465-0}</span>
</span></span><span style="display:flex;"><span>}
</span></span></code></pre></div>]]></content:encoded></item><item><title>Overview of the TREC 2011 Chemical IR Track Benchmark</title><link>https://hunterheidenreich.com/notes/chemistry/optical-structure-recognition/benchmarks/trec-chem-2011/</link><pubDate>Tue, 16 Dec 2025 00:00:00 +0000</pubDate><guid>https://hunterheidenreich.com/notes/chemistry/optical-structure-recognition/benchmarks/trec-chem-2011/</guid><description>Overview of the 2011 TREC Chemical IR track, establishing benchmarks for patent prior art, technology surveys, and chemical image recognition.</description><content:encoded><![CDATA[<h2 id="contribution-establishing-chemical-ir-benchmarks">Contribution: Establishing Chemical IR Benchmarks</h2>
<p>This is a <strong>Resource ($\Psi_{\text{Resource}}$)</strong> paper with a secondary contribution in <strong>Systematization ($\Psi_{\text{Systematization}}$)</strong>.</p>
<p>It serves as an infrastructural foundation for the field by establishing the &ldquo;yardstick&rdquo; for chemical information retrieval. It defines three distinct tasks, curates the necessary datasets (text and image), and creates the evaluation metrics required to measure progress. Secondarily, it systematizes the field by analyzing 36 different runs from 9 research groups, categorizing the performance of various approaches against these new benchmarks.</p>
<h2 id="motivation-bridging-text-and-image-search-in-chemistry">Motivation: Bridging Text and Image Search in Chemistry</h2>
<p>The primary motivation is to bridge the gap between distinct research communities (text mining and image understanding), which are both essential for chemical information retrieval but rarely interact. Professional searchers in chemistry rely heavily on non-textual information (structures), yet prior evaluation efforts lacked specific tasks to handle image data. The track aims to provide professional searchers with a clear understanding of the limits of current tools while stimulating research interest in both patent retrieval and chemical image recognition.</p>
<h2 id="novelty-the-image-to-structure-i2s-task">Novelty: The Image-to-Structure (I2S) Task</h2>
<p>The core novelty is the introduction of the <strong>Image-to-Structure (I2S)</strong> task. While previous years provided image data, this was the first specific task requiring participants to translate a raster image of a molecule into a chemical structure file. Additionally, the Technology Survey (TS) task shifted its focus specifically to <strong>biomedical and pharmaceutical topics</strong> to investigate how general IR systems handle the high terminological diversity (synonyms, abbreviations) typical of biomedical patents.</p>
<h2 id="methodology-trec-2011-task-formulations">Methodology: TREC 2011 Task Formulations</h2>
<p>The organizers conducted a large-scale benchmarking campaign across three specific tasks:</p>
<ol>
<li><strong>Prior Art (PA) Task</strong>: A patent retrieval task using 1,000 topics distributed among the EPO, USPTO, and WIPO.</li>
<li><strong>Technology Survey (TS) Task</strong>: An ad-hoc retrieval task focused on 6 specific biomedical/pharmaceutical information needs (e.g., &ldquo;Tests for HCG hormone&rdquo;).</li>
<li><strong>Image-to-Structure (I2S) Task</strong>: A recognition task using 1,000 training images and 1,000 evaluation images from USPTO patents, where systems had to generate the correct chemical structure (MOL file).</li>
</ol>
<p>A total of 9 groups submitted 36 runs across these tasks. Relevance judgments were performed using stratified sampling and a dual-evaluator system (junior and senior experts) for the TS task.</p>
<h2 id="outcomes-task-achievements-and-limitations">Outcomes: Task Achievements and Limitations</h2>
<ul>
<li><strong>Image-to-Structure Success</strong>: The new I2S task was the most successful task that year, with 5 participating groups submitting 11 runs. All participants recognized over 60% of the structures.</li>
<li><strong>Prior Art Saturation</strong>: Only 2 groups participated in the PA task. The organizers concluded that this task had reached its &ldquo;final point,&rdquo; having learned the extent to which relevant documents can be retrieved in one pass for chemical patent applications.</li>
<li><strong>Biomedical Complexity</strong>: Four teams submitted 14 runs for the TS task, which highlighted the complexity of biomedical queries. The use of specialized domain experts (senior evaluators) and students (junior evaluators) provided high-quality relevance data, though the small number of topics (6) limits broad generalization.</li>
</ul>
<hr>
<h2 id="reproducibility-details">Reproducibility Details</h2>
<p>The following details describe the benchmark environment established by the organizers, allowing for the replication of the evaluation.</p>
<h3 id="data">Data</h3>
<p>The track utilized a large collection of approximately 500GB of compressed text and image data.</p>
<table>
	<thead>
			<tr>
					<th style="text-align: left">Task</th>
					<th style="text-align: left">Dataset / Source</th>
					<th style="text-align: left">Size / Split</th>
					<th style="text-align: left">Notes</th>
			</tr>
	</thead>
	<tbody>
			<tr>
					<td style="text-align: left"><strong>Prior Art (PA)</strong></td>
					<td style="text-align: left">EPO, USPTO, WIPO patents</td>
					<td style="text-align: left">1,000 Topics</td>
					<td style="text-align: left">Distributed: 334 EPO, 333 USPTO, 333 WIPO.</td>
			</tr>
			<tr>
					<td style="text-align: left"><strong>Tech Survey (TS)</strong></td>
					<td style="text-align: left">Biomedical patents/articles</td>
					<td style="text-align: left">6 Topics</td>
					<td style="text-align: left">Topics formulated by domain experts; focused on complexity (synonyms, abbreviations).</td>
			</tr>
			<tr>
					<td style="text-align: left"><strong>Image (I2S)</strong></td>
					<td style="text-align: left">USPTO patent images</td>
					<td style="text-align: left">1,000 Train / 1,000 Eval</td>
					<td style="text-align: left">Criteria: No polymers, &ldquo;organic&rdquo; elements only, MW &lt; 1000, single fragment.</td>
			</tr>
	</tbody>
</table>
<h3 id="algorithms">Algorithms</h3>
<p>The paper defines specific <strong>evaluation algorithms</strong> used to ground-truth the submissions:</p>
<ul>
<li><strong>Stratified Sampling (TS)</strong>: Pools were generated using the method from Yilmaz et al. (2008). The pool included the top 10 documents from all runs, 30% of the top 30, and 10% of the rest down to rank 1000.</li>
<li><strong>InChI Matching (I2S)</strong>: Evaluation relied on generating <strong>Standard <a href="/notes/chemistry/molecular-representations/notations/inchi-2013/">InChI</a> Keys</strong> from both the ground truth MOL files and the participant submissions. Success was defined by exact string matching of these keys. This provided a relatively controversy-free measure of chemical identity.</li>
</ul>
<h3 id="models">Models</h3>
<p>While the paper does not propose a single model, it evaluates several distinct approaches submitted by participants. Notable systems mentioned include:</p>
<ul>
<li><strong>OSRA</strong> (SAIC-Frederik / NIH)</li>
<li><strong>ChemReader</strong> (University of Michigan)</li>
<li><strong>ChemOCR</strong> (Fraunhofer SCAI)</li>
<li><strong>UoB</strong> (University of Birmingham)</li>
<li><strong>GGA</strong> (GGA Software)</li>
</ul>
<h3 id="evaluation">Evaluation</h3>
<p>Performance was measured using standard IR metrics for text and exact matching for images.</p>
<table>
	<thead>
			<tr>
					<th style="text-align: left">Metric</th>
					<th style="text-align: left">Task</th>
					<th style="text-align: left">Description</th>
			</tr>
	</thead>
	<tbody>
			<tr>
					<td style="text-align: left"><strong>MAP / xinfAP</strong></td>
					<td style="text-align: left">Prior Art / Tech Survey</td>
					<td style="text-align: left">Mean Average Precision ($\text{MAP}$) and Extended Inferred AP ($\text{xinfAP}$) were used to measure retrieval quality.</td>
			</tr>
			<tr>
					<td style="text-align: left"><strong>infNDCG</strong></td>
					<td style="text-align: left">Tech Survey</td>
					<td style="text-align: left">Used to account for graded relevance (highly relevant vs relevant, formalized as $\text{infNDCG}$).</td>
			</tr>
			<tr>
					<td style="text-align: left"><strong>Recall</strong></td>
					<td style="text-align: left">Image-to-Structure</td>
					<td style="text-align: left">Percentage of images where the generated InChI key matched exactly ($R = \frac{\text{Correct}}{\text{Total}}$).</td>
			</tr>
	</tbody>
</table>
<h3 id="artifacts">Artifacts</h3>
<table>
	<thead>
			<tr>
					<th style="text-align: left">Artifact</th>
					<th style="text-align: left">Type</th>
					<th style="text-align: left">License</th>
					<th style="text-align: left">Notes</th>
			</tr>
	</thead>
	<tbody>
			<tr>
					<td style="text-align: left"><a href="https://trec.nist.gov/data/chemical11.html">TREC 2011 Chemistry Track Data</a></td>
					<td style="text-align: left">Dataset</td>
					<td style="text-align: left">Unknown</td>
					<td style="text-align: left">Topics, relevance judgments, and image sets for all three tasks</td>
			</tr>
			<tr>
					<td style="text-align: left"><a href="https://trec.nist.gov/pubs/trec20/t20.proceedings.html">TREC 2011 Proceedings</a></td>
					<td style="text-align: left">Other</td>
					<td style="text-align: left">Unknown</td>
					<td style="text-align: left">Full proceedings including participant system descriptions</td>
			</tr>
	</tbody>
</table>
<h3 id="hardware">Hardware</h3>
<p>Specific hardware requirements for the participating systems are not detailed in this overview, but the dataset size (500GB) implies significant storage and I/O throughput requirements.</p>
<hr>
<h2 id="paper-information">Paper Information</h2>
<p><strong>Citation</strong>: Lupu, M., Gurulingappa, H., Filippov, I., Zhao, J., Fluck, J., Zimmermann, M., Huang, J., &amp; Tait, J. (2011). Overview of the TREC 2011 Chemical IR Track. In <em>Proceedings of the Twentieth Text REtrieval Conference (TREC 2011)</em>.</p>
<p><strong>Publication</strong>: Text REtrieval Conference (TREC) 2011</p>
<p><strong>Resources</strong>:</p>
<ul>
<li><a href="https://trec.nist.gov/pubs/trec20/t20.proceedings.html">TREC 2011 Proceedings</a></li>
<li><a href="https://trec.nist.gov/data/chemical11.html">TREC 2011 Chemistry Track Data</a></li>
</ul>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-bibtex" data-lang="bibtex"><span style="display:flex;"><span><span style="color:#a6e22e">@inproceedings</span>{lupuOverviewTREC20112011,
</span></span><span style="display:flex;"><span>  <span style="color:#a6e22e">title</span> = <span style="color:#e6db74">{Overview of the {{TREC}} 2011 {{Chemical IR Track}}}</span>,
</span></span><span style="display:flex;"><span>  <span style="color:#a6e22e">author</span> = <span style="color:#e6db74">{Lupu, Mihai and Gurulingappa, Harsha and Filippov, Igor and Zhao, Jiashu and Fluck, Juliane and Zimmermann, Marc and Huang, Jimmy and Tait, John}</span>,
</span></span><span style="display:flex;"><span>  <span style="color:#a6e22e">year</span> = <span style="color:#e6db74">{2011}</span>,
</span></span><span style="display:flex;"><span>  <span style="color:#a6e22e">booktitle</span> = <span style="color:#e6db74">{Proceedings of the Twentieth Text REtrieval Conference (TREC 2011)}</span>,
</span></span><span style="display:flex;"><span>  <span style="color:#a6e22e">publisher</span> = <span style="color:#e6db74">{NIST}</span>,
</span></span><span style="display:flex;"><span>  <span style="color:#a6e22e">abstract</span> = <span style="color:#e6db74">{The third year of the Chemical IR evaluation track benefitted from the support of many more people interested in the domain, as shown by the number of co-authors of this overview paper. We continued the two tasks we had before, and introduced a new task focused on chemical image recognition. The objective is to gradually move towards systems really useful to the practitioners, and in chemistry, this involves both text and images. The track had a total of 9 groups participating, submitting a total of 36 runs.}</span>,
</span></span><span style="display:flex;"><span>  <span style="color:#a6e22e">langid</span> = <span style="color:#e6db74">{english}</span>
</span></span><span style="display:flex;"><span>}
</span></span></code></pre></div>]]></content:encoded></item><item><title>CLEF-IP 2012: Patent and Chemical Structure Benchmark</title><link>https://hunterheidenreich.com/notes/chemistry/optical-structure-recognition/benchmarks/clef-ip-2012/</link><pubDate>Tue, 16 Dec 2025 00:00:00 +0000</pubDate><guid>https://hunterheidenreich.com/notes/chemistry/optical-structure-recognition/benchmarks/clef-ip-2012/</guid><description>Overview of the CLEF-IP 2012 benchmarking lab focusing on patent passage retrieval, flowchart recognition, and chemical structure extraction.</description><content:encoded><![CDATA[<h2 id="patent-retrieval-and-the-clef-ip-2012-benchmark">Patent Retrieval and the CLEF-IP 2012 Benchmark</h2>
<p>This is a <strong>Resource</strong> paper (benchmark infrastructure). It establishes a standardized test bed for the Intellectual Property (IP) Information Retrieval community by defining tasks, curating datasets (topics and relevance judgments), and establishing evaluation protocols. The paper does not propose a new method itself but aggregates and analyzes the performance of participant systems on these shared tasks.</p>
<h2 id="motivation-for-standardized-ip-information-retrieval">Motivation for Standardized IP Information Retrieval</h2>
<p>The volume of patent applications is increasing rapidly, necessitating automated methods to help patent experts find prior art and classify documents.</p>
<ul>
<li><strong>Economic Impact:</strong> Thorough searches are critical due to the high economic value of granted patents.</li>
<li><strong>Complexity:</strong> Patent work-flows are specific; examiners need to find prior art for specific <em>claims</em> alongside whole documents, and often rely on non-textual data like flowcharts and chemical diagrams.</li>
<li><strong>Gap:</strong> Existing general IR tools are insufficient for the specific granularity (passages, images, structures) required in the IP domain.</li>
</ul>
<h2 id="novel-multi-modal-tasks-claims-flowcharts-and-chemicals">Novel Multi-modal Tasks: Claims, Flowcharts, and Chemicals</h2>
<p>The 2012 edition of the lab introduced three specific tasks targeting different modalities of patent data:</p>
<ol>
<li><strong>Passage Retrieval starting from Claims:</strong> Moving beyond document-level retrieval to identifying specific relevant passages based on claim text.</li>
<li><strong>Flowchart Recognition:</strong> A new image analysis task requiring the extraction of structural information (nodes, edges, text) from patent images.</li>
<li><strong>Chemical Structure Recognition:</strong> A dual task of segmenting molecular diagrams from full pages and recognizing them into structural files (MOL), specifically addressing the challenge of Markush structures in patents.</li>
</ol>
<h2 id="benchmarking-setup-and-evaluation">Benchmarking Setup and Evaluation</h2>
<p>The &ldquo;experiments&rdquo; were the benchmarking tasks themselves, performed by participants (e.g., University of Birmingham, SAIC, TU Vienna).</p>
<ul>
<li><strong>Passage Retrieval:</strong> Participants retrieved documents and passages for 105 test topics (sets of claims) from a corpus of 1.5 million patents. Performance was measured using PRES, Recall, and MAP at the document level, and AP/Precision at the passage level.</li>
<li><strong>Flowchart Recognition:</strong> Participants extracted graph structures from 100 test images. Evaluation compared the submitted graphs to ground truth using a distance metric based on the Maximum Common Subgraph (MCS).</li>
<li><strong>Chemical Structure:</strong>
<ul>
<li><em>Segmentation:</em> Identifying bounding boxes of chemical structures in 30 multipage TIFF patents.</li>
<li><em>Recognition:</em> Converting 865 &ldquo;automatic&rdquo; (standard MOL) and 95 &ldquo;manual&rdquo; (Markush/complex) diagrams into structure files.</li>
</ul>
</li>
</ul>
<h2 id="key-findings-and-baseline-results">Key Findings and Baseline Results</h2>
<ul>
<li><strong>Passage Retrieval:</strong> Approaches varied from two-step retrieval (document then passage) to full NLP techniques. Translation tools were universally used due to the multilingual corpus (English, German, French).</li>
<li><strong>Chemical Recognition:</strong> The best performing system (UoB, run uob-4) achieved 92% recall on total structures (886/960), with 96% on the automatic set and 57% on the manual set. SAIC achieved 83% total recall. The manual evaluation highlighted a critical need for standards extending MOL files to support Markush structures, which are common in patents but poorly supported by current tools.</li>
<li><strong>Flowchart Recognition:</strong> The evaluation was not completed at the time of writing the workshop notes. The evaluation required a combination of structural matching and edit-distance for text labels because OCR outputs rarely &ldquo;hard-matched&rdquo; the gold standard.</li>
</ul>
<h3 id="chemical-structure-recognition-results">Chemical Structure Recognition Results</h3>
<p><strong>Segmentation</strong> (SAIC, best run using OSRA native rendering):</p>
<table>
	<thead>
			<tr>
					<th>Tolerance (px)</th>
					<th>Precision</th>
					<th>Recall</th>
					<th>$F_1$</th>
			</tr>
	</thead>
	<tbody>
			<tr>
					<td>0</td>
					<td>0.708</td>
					<td>0.686</td>
					<td>0.697</td>
			</tr>
			<tr>
					<td>10</td>
					<td>0.793</td>
					<td>0.769</td>
					<td>0.781</td>
			</tr>
			<tr>
					<td>20</td>
					<td>0.821</td>
					<td>0.795</td>
					<td>0.808</td>
			</tr>
			<tr>
					<td>40</td>
					<td>0.867</td>
					<td>0.840</td>
					<td>0.853</td>
			</tr>
			<tr>
					<td>55</td>
					<td>0.887</td>
					<td>0.860</td>
					<td>0.873</td>
			</tr>
	</tbody>
</table>
<p><strong>Recognition</strong> (automatic and manual sets):</p>
<table>
	<thead>
			<tr>
					<th>System</th>
					<th>Auto (#/865)</th>
					<th>Auto %</th>
					<th>Manual (#/95)</th>
					<th>Manual %</th>
					<th>Total (#/960)</th>
					<th>Total %</th>
			</tr>
	</thead>
	<tbody>
			<tr>
					<td>SAIC</td>
					<td>761</td>
					<td>88%</td>
					<td>38</td>
					<td>40%</td>
					<td>799</td>
					<td>83%</td>
			</tr>
			<tr>
					<td>UoB-1</td>
					<td>832</td>
					<td>96%</td>
					<td>44</td>
					<td>46%</td>
					<td>876</td>
					<td>91%</td>
			</tr>
			<tr>
					<td>UoB-2</td>
					<td>821</td>
					<td>95%</td>
					<td>56</td>
					<td>59%</td>
					<td>877</td>
					<td>91%</td>
			</tr>
			<tr>
					<td>UoB-3</td>
					<td>821</td>
					<td>95%</td>
					<td>44</td>
					<td>46%</td>
					<td>865</td>
					<td>90%</td>
			</tr>
			<tr>
					<td>UoB-4</td>
					<td>832</td>
					<td>96%</td>
					<td>54</td>
					<td>57%</td>
					<td>886</td>
					<td>92%</td>
			</tr>
	</tbody>
</table>
<hr>
<h2 id="reproducibility-details">Reproducibility Details</h2>
<h3 id="data">Data</h3>
<p>The collection focuses on European Patent Office (EPO) and WIPO documents published up to 2002.</p>
<p><strong>1. Passage Retrieval Data</strong></p>
<ul>
<li><strong>Corpus:</strong> &gt;1.5 million XML patent documents (EP and WO sources).</li>
<li><strong>Training Set:</strong> 51 topics (sets of claims) with relevance judgments (18 DE, 21 EN, 12 FR).</li>
<li><strong>Test Set:</strong> 105 topics (35 per language).</li>
<li><strong>Topic Source:</strong> Extracted manually from search reports listing &ldquo;X&rdquo; or &ldquo;Y&rdquo; citations (highly relevant prior art).</li>
</ul>
<p><strong>2. Flowchart Data</strong></p>
<ul>
<li><strong>Format:</strong> Black and white TIFF images.</li>
<li><strong>Training Set:</strong> 50 images with textual graph representations.</li>
<li><strong>Test Set:</strong> 100 images.</li>
<li><strong>Ground Truth:</strong> A defined textual format describing nodes (<code>NO</code>), directed edges (<code>DE</code>), undirected edges (<code>UE</code>), and meta-data (<code>MT</code>).</li>
</ul>
<p><strong>3. Chemical Structure Data</strong></p>
<ul>
<li><strong>Segmentation:</strong> 30 patent files rendered as 300dpi monochrome multipage TIFFs.</li>
<li><strong>Recognition (Automatic Set):</strong> 865 diagram images fully representable in standard MOL format.</li>
<li><strong>Recognition (Manual Set):</strong> 95 diagram images containing Markush structures or variability not supported by standard MOL.</li>
</ul>
<h3 id="algorithms">Algorithms</h3>
<p><strong>Ground Truth Generation:</strong></p>
<ul>
<li><strong>Qrels Generator:</strong> An in-house tool was used to manually map search report citations to specific XML passages (XPaths) for the passage retrieval task.</li>
<li><strong>McGregor Algorithm:</strong> Used for the flowchart evaluation to compute the Maximum Common Subgraph (MCS) between participant submissions and ground truth.</li>
</ul>
<h3 id="evaluation">Evaluation</h3>
<p><strong>Passage Retrieval Metrics:</strong></p>
<ul>
<li><strong>Document Level:</strong> PRES (Patent Retrieval Evaluation Score), Recall, MAP. Cut-off at 100 documents.</li>
<li><strong>Passage Level:</strong> $AP(D)$ (Average Precision at document level) and $Precision(D)$ (Precision at document level), averaged across all relevant documents for a topic.</li>
</ul>
<p><strong>Flowchart Recognition Metric:</strong></p>
<ul>
<li><strong>Graph Distance ($d$):</strong> Defined quantitatively based on the Maximum Common Subgraph (MCS) between a target flowchart ($F_t$) and a submitted flowchart ($F_s$):
$$
\begin{aligned}
d(F_t, F_s) &amp;= 1 - \frac{|mcs(F_t, F_s)|}{|F_t| + |F_s| - |mcs(F_t, F_s)|}
\end{aligned}
$$
where $|F|$ represents the size of the graph (nodes + edges).</li>
<li><strong>Levels:</strong> Evaluated at three levels: Basic (structure only), Intermediate (structure + node types), and Complete (structure + types + text labels).</li>
</ul>
<p><strong>Chemical Structure Metrics:</strong></p>
<ul>
<li><strong>Segmentation:</strong> Precision, Recall, and $F_1$ based on bounding box matches. A match is valid if borders are within a tolerance (0 to 55 pixels).</li>
<li><strong>Recognition:</strong>
<ul>
<li><em>Automatic:</em> Comparison of InChI strings generated by Open Babel.</li>
<li><em>Manual:</em> Visual comparison of images rendered by MarvinView.</li>
</ul>
</li>
</ul>
<hr>
<h2 id="reproducibility">Reproducibility</h2>
<p>The CLEF-IP 2012 benchmark data was distributed to registered participants through the CLEF evaluation framework. The patent corpus is derived from the MAREC dataset (EPO and WIPO documents published until 2002). Evaluation tools for segmentation (bounding box comparison) and recognition (InChI comparison via Open Babel) were developed in-house by the organizers. The McGregor algorithm implementation for flowchart evaluation was also custom-built.</p>
<p>No public code repositories or pre-trained models are associated with this paper, as it is a benchmarking infrastructure paper. The evaluation protocols and data formats are fully described in the paper.</p>
<table>
	<thead>
			<tr>
					<th>Artifact</th>
					<th>Type</th>
					<th>License</th>
					<th>Notes</th>
			</tr>
	</thead>
	<tbody>
			<tr>
					<td><a href="https://www.ifs.tuwien.ac.at/~clef-ip/">CLEF-IP 2012 data</a></td>
					<td>Dataset</td>
					<td>Unknown</td>
					<td>Distributed to registered CLEF participants; no persistent public archive</td>
			</tr>
			<tr>
					<td><a href="https://www.ir-facility.org/prototypes/marec">MAREC corpus</a></td>
					<td>Dataset</td>
					<td>Unknown</td>
					<td>Source patent corpus (EPO/WIPO documents up to 2002)</td>
			</tr>
	</tbody>
</table>
<ul>
<li><strong>Status</strong>: Partially Reproducible</li>
<li><strong>Missing components</strong>: The benchmark datasets were distributed to participants and are not hosted on a persistent public repository. The in-house evaluation tools (qrels generator, segmentation comparator, flowchart distance calculator) are not publicly released.</li>
</ul>
<h2 id="paper-information">Paper Information</h2>
<p><strong>Citation</strong>: Piroi, F., Lupu, M., Hanbury, A., Magdy, W., Sexton, A. P., &amp; Filippov, I. (2012). CLEF-IP 2012: Retrieval Experiments in the Intellectual Property Domain. <em>CLEF 2012 Working Notes</em>, CEUR Workshop Proceedings, Vol. 1178.</p>
<p><strong>Publication</strong>: CLEF 2012 Working Notes (CEUR-WS Vol. 1178)</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-bibtex" data-lang="bibtex"><span style="display:flex;"><span><span style="color:#a6e22e">@inproceedings</span>{piroi2012clefip,
</span></span><span style="display:flex;"><span>  <span style="color:#a6e22e">title</span>=<span style="color:#e6db74">{CLEF-IP 2012: Retrieval Experiments in the Intellectual Property Domain}</span>,
</span></span><span style="display:flex;"><span>  <span style="color:#a6e22e">author</span>=<span style="color:#e6db74">{Piroi, Florina and Lupu, Mihai and Hanbury, Allan and Magdy, Walid and Sexton, Alan P. and Filippov, Igor}</span>,
</span></span><span style="display:flex;"><span>  <span style="color:#a6e22e">booktitle</span>=<span style="color:#e6db74">{CLEF 2012 Working Notes}</span>,
</span></span><span style="display:flex;"><span>  <span style="color:#a6e22e">series</span>=<span style="color:#e6db74">{CEUR Workshop Proceedings}</span>,
</span></span><span style="display:flex;"><span>  <span style="color:#a6e22e">volume</span>=<span style="color:#e6db74">{1178}</span>,
</span></span><span style="display:flex;"><span>  <span style="color:#a6e22e">year</span>=<span style="color:#e6db74">{2012}</span>,
</span></span><span style="display:flex;"><span>  <span style="color:#a6e22e">publisher</span>=<span style="color:#e6db74">{CEUR-WS.org}</span>,
</span></span><span style="display:flex;"><span>  <span style="color:#a6e22e">url</span>=<span style="color:#e6db74">{https://ceur-ws.org/Vol-1178/CLEF2012wn-CLEFIP-PiroiEt2012.pdf}</span>
</span></span><span style="display:flex;"><span>}
</span></span></code></pre></div>]]></content:encoded></item><item><title>OCSR Methods: A Taxonomy of Approaches</title><link>https://hunterheidenreich.com/notes/chemistry/optical-structure-recognition/benchmarks/ocsr-methods/</link><pubDate>Sun, 14 Dec 2025 00:00:00 +0000</pubDate><guid>https://hunterheidenreich.com/notes/chemistry/optical-structure-recognition/benchmarks/ocsr-methods/</guid><description>Overview of optical chemical structure recognition methods organized by approach, from deep learning to rule-based systems.</description><content:encoded><![CDATA[<h2 id="overview">Overview</h2>
<p>Optical Chemical Structure Recognition (OCSR) aims to automatically extract machine-readable molecular representations (e.g., SMILES, <a href="/notes/chemistry/molecular-representations/notations/inchi-2013/">InChI</a>, mol files) from images of chemical structures. Methods have evolved from early rule-based systems to modern deep learning approaches.</p>
<p>This note organizes OCSR methods by their fundamental approach, providing a framework for understanding the landscape of techniques.</p>
<h2 id="common-limitations-and-failure-modes">Common Limitations and Failure Modes</h2>
<p>Regardless of the underlying paradigm, most OCSR systems struggle with a common set of challenges:</p>
<ol>
<li><strong>Stereochemistry</strong>: Ambiguous wedge/dash bonds, varying drawing conventions, and implicit stereocenters frequently lead to incorrect isomer generation.</li>
<li><strong>Markush Structures</strong>: Generic structures with variable R-groups (common in patents) require complex subgraph mapping that sequence-based models often fail to capture.</li>
<li><strong>Image Degradation</strong>: Artifacts, low resolution, skewed scans, and hand-drawn irregularities degrade the performance of both rule-based heuristics and CNN feature extractors.</li>
<li><strong>Superatoms and Abbreviations</strong>: Textual abbreviations (e.g., &ldquo;Ph&rdquo;, &ldquo;t-Bu&rdquo;, &ldquo;BoC&rdquo;) embedded within the image require joint optical character recognition (OCR) and structural parsing.</li>
</ol>
<h2 id="review--survey-papers">Review &amp; Survey Papers</h2>
<p>Comprehensive surveys and systematization of knowledge papers that organize and synthesize the OCSR literature.</p>
<table>
	<thead>
			<tr>
					<th>Year</th>
					<th>Paper</th>
					<th>Notes</th>
					<th>Focus</th>
			</tr>
	</thead>
	<tbody>
			<tr>
					<td>2020</td>
					<td><a href="https://doi.org/10.1186/s13321-020-00465-0">A review of optical chemical structure recognition tools</a></td>
					<td><a href="/notes/chemistry/optical-structure-recognition/benchmarks/rajan-ocsr-review-2020/">Rajan et al. 2020</a></td>
					<td>Survey of 30 years of OCSR development (1990-2019); benchmark of three open-source tools (OSRA, Imago, MolVec) on four datasets</td>
			</tr>
			<tr>
					<td>2022</td>
					<td><a href="https://doi.org/10.1186/s13321-022-00642-3">Review of techniques and models used in optical chemical structure recognition</a></td>
					<td><a href="/notes/chemistry/optical-structure-recognition/benchmarks/musazade-ocsr-review-2022/">Musazade et al. 2022</a></td>
					<td>Systematization of OCSR evolution from rule-based systems to modern deep learning; identifies paradigm shift to image captioning and critiques evaluation metrics</td>
			</tr>
			<tr>
					<td>2024</td>
					<td><a href="https://doi.org/10.1039/D3DD00228D">Comparing software tools for optical chemical structure recognition</a></td>
					<td><a href="/notes/chemistry/optical-structure-recognition/benchmarks/krasnov-ocsr-benchmark-2024/">Krasnov et al. 2024</a></td>
					<td>Benchmark of 8 open-access tools on 2,702 manually curated patent images; proposes ChemIC classifier for hybrid routing approach</td>
			</tr>
	</tbody>
</table>
<h2 id="deep-learning-methods">Deep Learning Methods</h2>
<p>End-to-end neural network architectures that learn to map images directly to molecular representations.</p>
<p><strong>Note on Paper Types</strong>: Papers listed below are primarily <strong>Method</strong> ($\Psi_{\text{Method}}$) papers focused on novel architectures and performance improvements. Some also have secondary <strong>Resource</strong> ($\Psi_{\text{Resource}}$) contributions through released tools or datasets. See the <a href="/notes/research-methods/ai-physical-sciences-paper-taxonomy/">AI and Physical Sciences paper taxonomy</a> for classification details.</p>
<h3 id="image-to-sequence-paradigm">Image-to-Sequence Paradigm</h3>
<p>Treating chemical structure recognition as an image captioning task, these methods use encoder-decoder architectures (often with attention mechanisms) to generate sequential molecular representations like SMILES directly from pixels. Formally, given an image $I$, the model learns to sequentially output tokens $y_t$ to maximize the conditional probability:
$$ p(Y|I) = \prod_{t=1}^{T} p(y_t | y_{&lt;t}, I; \theta) $$
where $\theta$ represents the model parameters. This paradigm is powerful but can hallucinate chemically invalid structures if the decoder fails to learn chemical syntax rules.</p>
<table>
	<thead>
			<tr>
					<th>Year</th>
					<th>Paper</th>
					<th>Notes</th>
					<th>Architecture</th>
			</tr>
	</thead>
	<tbody>
			<tr>
					<td>2019</td>
					<td><a href="https://doi.org/10.1021/acs.jcim.8b00669">Molecular Structure Extraction From Documents Using Deep Learning</a></td>
					<td><a href="/notes/chemistry/optical-structure-recognition/image-to-sequence/staker-deep-learning-2019/">Staker et al. Notes</a></td>
					<td>U-Net segmentation + CNN-GridLSTM encoder-decoder with attention</td>
			</tr>
			<tr>
					<td>2020</td>
					<td><a href="https://doi.org/10.1186/s13321-020-00469-w">DECIMER: towards deep learning for chemical image recognition</a></td>
					<td><a href="/notes/chemistry/optical-structure-recognition/image-to-sequence/decimer/">DECIMER Notes</a></td>
					<td>Inception V3 encoder + GRU decoder with attention</td>
			</tr>
			<tr>
					<td>2021</td>
					<td><a href="https://doi.org/10.1039/D1SC02957F">ChemPix: automated recognition of hand-drawn hydrocarbon structures</a></td>
					<td><a href="/notes/chemistry/optical-structure-recognition/hand-drawn/chempix/">ChemPix Notes</a></td>
					<td>CNN encoder + LSTM decoder with attention</td>
			</tr>
			<tr>
					<td>2021</td>
					<td><a href="https://doi.org/10.1186/s13321-021-00538-8">DECIMER 1.0: deep learning for chemical image recognition using transformers</a></td>
					<td><a href="/notes/chemistry/optical-structure-recognition/image-to-sequence/decimer-1.0/">DECIMER 1.0 Notes</a></td>
					<td>EfficientNet-B3 encoder + Transformer decoder with SELFIES output</td>
			</tr>
			<tr>
					<td>2021</td>
					<td><a href="https://doi.org/10.48550/arXiv.2104.14721">End-to-End Attention-based Image Captioning</a></td>
					<td><a href="/notes/chemistry/optical-structure-recognition/image-to-sequence/vit-inchi-transformer/">ViT-InChI Transformer Notes</a></td>
					<td>Vision Transformer encoder + Transformer decoder with InChI output</td>
			</tr>
			<tr>
					<td>2021</td>
					<td><a href="https://doi.org/10.1039/D1SC01839F">Img2Mol - accurate SMILES recognition from molecular graphical depictions</a></td>
					<td><a href="/notes/chemistry/optical-structure-recognition/image-to-sequence/img2mol/">Img2Mol Notes</a></td>
					<td>CNN encoder + pre-trained CDDD decoder for continuous embedding</td>
			</tr>
			<tr>
					<td>2021</td>
					<td><a href="https://doi.org/10.48550/arXiv.2109.04202">IMG2SMI: Translating Molecular Structure Images to SMILES</a></td>
					<td><a href="/notes/chemistry/optical-structure-recognition/image-to-sequence/img2smi/">IMG2SMI Notes</a></td>
					<td>ResNet-101 encoder + Transformer decoder with SELFIES output</td>
			</tr>
			<tr>
					<td>2022</td>
					<td><a href="https://doi.org/10.3390/app12020680">Automated Recognition of Chemical Molecule Images Based on an Improved TNT Model</a></td>
					<td><a href="/notes/chemistry/optical-structure-recognition/image-to-sequence/icmdt/">ICMDT Notes</a></td>
					<td>Deep TNT encoder + Transformer decoder with InChI output</td>
			</tr>
			<tr>
					<td>2022</td>
					<td><a href="https://doi.org/10.1002/cmtd.202100069">Image2SMILES: Transformer-Based Molecular Optical Recognition Engine</a></td>
					<td><a href="/notes/chemistry/optical-structure-recognition/image-to-sequence/image2smiles/">Image2SMILES Notes</a></td>
					<td>ResNet-50 encoder + Transformer decoder with FG-SMILES output</td>
			</tr>
			<tr>
					<td>2022</td>
					<td><a href="https://doi.org/10.1093/bioinformatics/btac545">MICER: a pre-trained encoder-decoder architecture for molecular image captioning</a></td>
					<td><a href="/notes/chemistry/optical-structure-recognition/image-to-sequence/micer/">MICER Notes</a></td>
					<td>Fine-tuned ResNet101 encoder + LSTM decoder with attention</td>
			</tr>
			<tr>
					<td>2022</td>
					<td><a href="https://doi.org/10.1039/D1DD00013F">Performance of chemical structure string representations for chemical image recognition using transformers</a></td>
					<td><a href="/notes/chemistry/optical-structure-recognition/benchmarks/rajan-string-representations-2022/">Rajan String Representations</a></td>
					<td>Comparative ablation: SMILES vs DeepSMILES vs SELFIES vs InChI</td>
			</tr>
			<tr>
					<td>2022</td>
					<td><a href="https://doi.org/10.1186/s13321-022-00624-5">SwinOCSR: end-to-end optical chemical structure recognition using a Swin Transformer</a></td>
					<td><a href="/notes/chemistry/optical-structure-recognition/image-to-sequence/swinocsr/">SwinOCSR Notes</a></td>
					<td>Swin Transformer encoder + Transformer decoder with DeepSMILES output</td>
			</tr>
			<tr>
					<td>2023</td>
					<td><a href="https://doi.org/10.1145/3581783.3612573">Handwritten Chemical Structure Image to Structure-Specific Markup Using Random Conditional Guided Decoder</a></td>
					<td><a href="/notes/chemistry/optical-structure-recognition/hand-drawn/hu-handwritten-rcgd-2023/">Hu et al. RCGD Notes</a></td>
					<td>DenseNet encoder + GRU decoder with attention and SSML output</td>
			</tr>
			<tr>
					<td>2023</td>
					<td><a href="https://doi.org/10.1038/s41467-023-40782-0">DECIMER.ai: an open platform for automated optical chemical structure identification, segmentation and recognition in scientific publications</a></td>
					<td><a href="/notes/chemistry/optical-structure-recognition/image-to-sequence/decimer-ai/">DECIMER.ai Notes</a></td>
					<td>EfficientNet-V2-M encoder + Transformer decoder with SMILES output</td>
			</tr>
			<tr>
					<td>2024</td>
					<td><a href="https://doi.org/10.1038/s41598-024-67496-7">ChemReco: automated recognition of hand-drawn carbon-hydrogen-oxygen structures using deep learning</a></td>
					<td><a href="/notes/chemistry/optical-structure-recognition/hand-drawn/chemreco/">ChemReco Notes</a></td>
					<td>EfficientNet encoder + Transformer decoder with SMILES output</td>
			</tr>
			<tr>
					<td>2024</td>
					<td><a href="https://doi.org/10.1186/s13321-024-00872-7">Advancements in hand-drawn chemical structure recognition through an enhanced DECIMER architecture</a></td>
					<td><a href="/notes/chemistry/optical-structure-recognition/hand-drawn/decimer-hand-drawn/">Enhanced DECIMER Notes</a></td>
					<td>EfficientNet-V2-M encoder + Transformer decoder with SMILES output</td>
			</tr>
			<tr>
					<td>2024</td>
					<td><a href="https://doi.org/10.1021/acs.jcim.3c02082">Image2InChI: Automated Molecular Optical Image Recognition</a></td>
					<td><a href="/notes/chemistry/optical-structure-recognition/image-to-sequence/image2inchi/">Image2InChI Notes</a></td>
					<td>Improved SwinTransformer encoder + Transformer decoder with InChI output</td>
			</tr>
			<tr>
					<td>2024</td>
					<td><a href="https://doi.org/10.1039/D4RA02442G">MMSSC-Net: multi-stage sequence cognitive networks for drug molecule recognition</a></td>
					<td><a href="/notes/chemistry/optical-structure-recognition/image-to-sequence/mmssc-net/">MMSSC-Net Notes</a></td>
					<td>SwinV2 encoder + GPT-2 decoder with MLP for multi-stage cognition</td>
			</tr>
			<tr>
					<td>2024</td>
					<td><a href="https://doi.org/10.48550/arXiv.2412.07594">RFL: Simplifying Chemical Structure Recognition with Ring-Free Language</a></td>
					<td><a href="/notes/chemistry/optical-structure-recognition/image-to-sequence/rfl/">RFL Notes</a></td>
					<td>DenseNet encoder + GRU decoder with hierarchical ring decomposition</td>
			</tr>
			<tr>
					<td>2025</td>
					<td><a href="https://doi.org/10.1021/acs.jpclett.5c03057">Dual-Path Global Awareness Transformer for Optical Chemical Structure Recognition</a></td>
					<td><a href="/notes/chemistry/optical-structure-recognition/image-to-sequence/dgat/">DGAT Notes</a></td>
					<td>ResNet-101 encoder + Transformer with CGFE/SDGLA modules and SMILES output</td>
			</tr>
			<tr>
					<td>2025</td>
					<td><a href="https://doi.org/10.48550/arXiv.2506.07553">GTR-CoT: Graph Traversal as Visual Chain of Thought for Molecular Structure Recognition</a></td>
					<td><a href="/notes/chemistry/optical-structure-recognition/vision-language/gtr-mol-vlm/">GTR-CoT Notes</a></td>
					<td>Qwen-VL 2.5 3B encoder-decoder with graph traversal chain-of-thought and SMILES output</td>
			</tr>
			<tr>
					<td>2025</td>
					<td><a href="https://doi.org/10.48550/arXiv.2411.11098">MolParser: End-to-end Visual Recognition of Molecule Structures in the Wild</a></td>
					<td><a href="/notes/chemistry/optical-structure-recognition/vision-language/mol-parser/">MolParser Notes</a></td>
					<td>Swin Transformer encoder + BART decoder with Extended SMILES (E-SMILES) output</td>
			</tr>
			<tr>
					<td>2025</td>
					<td><a href="https://doi.org/10.48550/arXiv.2511.17300">MolSight: OCSR with SMILES Pretraining, Multi-Granularity Learning and Reinforcement Learning</a></td>
					<td><a href="/notes/chemistry/optical-structure-recognition/image-to-sequence/molsight/">MolSight Notes</a></td>
					<td>EfficientViT-L1 encoder + Transformer decoder with RL (GRPO) and SMILES output</td>
			</tr>
			<tr>
					<td>2025</td>
					<td><a href="https://doi.org/10.48550/arXiv.2501.15415">OCSU: Optical Chemical Structure Understanding for Molecule-centric Scientific Discovery</a></td>
					<td><a href="/notes/chemistry/optical-structure-recognition/vision-language/ocsu/">OCSU Notes</a></td>
					<td>Mol-VL: Qwen2-VL encoder-decoder with multi-task learning for multi-level understanding</td>
			</tr>
	</tbody>
</table>
<h3 id="image-to-graph-paradigm">Image-to-Graph Paradigm</h3>
<p>Methods that explicitly construct molecular graphs as intermediate representations, identifying atoms as vertices $V$ and bonds as edges $E$ before converting to standard molecular formats. Graph approaches construct an adjacency matrix $A$ and feature vectors, effectively turning OCSR into a joint probability model over nodes, edges, and their spatial coordinates:
$$ p(G|I) = \prod_{v \in V} p(v|I) \prod_{u,v \in V} p(e_{uv}|v_u, v_v, I) $$
This avoids hallucinating invalid character strings and explicitly grounds the predictions to the image space (via bounding boxes/segmentation), improving interpretability.</p>
<table>
	<thead>
			<tr>
					<th>Year</th>
					<th>Paper</th>
					<th>Notes</th>
					<th>Architecture</th>
			</tr>
	</thead>
	<tbody>
			<tr>
					<td>2020</td>
					<td><a href="https://doi.org/10.1021/acs.jcim.0c00459">ChemGrapher: Optical Graph Recognition of Chemical Compounds by Deep Learning</a></td>
					<td><a href="/notes/chemistry/optical-structure-recognition/image-to-graph/chemgrapher-2020/">ChemGrapher Notes</a></td>
					<td>U-Net-based semantic segmentation + graph building algorithm + classification CNNs</td>
			</tr>
			<tr>
					<td>2022</td>
					<td><a href="https://doi.org/10.1093/bib/bbac033">ABC-Net: A divide-and-conquer based deep learning architecture for SMILES recognition</a></td>
					<td><a href="/notes/chemistry/optical-structure-recognition/image-to-graph/abc-net/">ABC-Net Notes</a></td>
					<td>U-Net-style FCN with keypoint detection heatmaps + multi-task property prediction</td>
			</tr>
			<tr>
					<td>2022</td>
					<td><a href="https://doi.org/10.48550/arXiv.2202.09580">Image-to-Graph Transformers for Chemical Structure Recognition</a></td>
					<td><a href="/notes/chemistry/optical-structure-recognition/image-to-graph/image-to-graph-transformers/">Image-to-Graph Transformers Notes</a></td>
					<td>ResNet-34 encoder + Transformer encoder + Graph-Aware Transformer (GRAT) decoder</td>
			</tr>
			<tr>
					<td>2022</td>
					<td><a href="https://doi.org/10.1021/acs.jcim.2c00733">MolMiner: You Only Look Once for Chemical Structure Recognition</a></td>
					<td><a href="/notes/chemistry/optical-structure-recognition/image-to-graph/molminer/">MolMiner Notes</a></td>
					<td>MobileNetV2 segmentation + YOLOv5 object detection + EasyOCR + graph construction</td>
			</tr>
			<tr>
					<td>2023</td>
					<td><a href="https://openaccess.thecvf.com/content/ICCV2023/html/Morin_MolGrapher_Graph-based_Visual_Recognition_of_Chemical_Structures_ICCV_2023_paper.html">MolGrapher: Graph-based Visual Recognition of Chemical Structures</a></td>
					<td><a href="/notes/chemistry/optical-structure-recognition/image-to-graph/molgrapher/">MolGrapher Notes</a></td>
					<td>ResNet-18 keypoint detector + supergraph construction + GNN classifier</td>
			</tr>
			<tr>
					<td>2023</td>
					<td><a href="https://doi.org/10.1021/acs.jcim.2c01480">MolScribe: Robust Molecular Structure Recognition with Image-To-Graph Generation</a></td>
					<td><a href="/notes/chemistry/optical-structure-recognition/image-to-graph/molscribe/">MolScribe Notes</a></td>
					<td>Swin Transformer encoder + Transformer decoder with explicit atom coordinates and bond prediction</td>
			</tr>
			<tr>
					<td>2024</td>
					<td><a href="https://doi.org/10.48550/arXiv.2404.01743">Atom-Level Optical Chemical Structure Recognition with Limited Supervision</a></td>
					<td><a href="/notes/chemistry/optical-structure-recognition/hand-drawn/atomlenz/">AtomLenz Notes</a></td>
					<td>Faster R-CNN object detection + graph constructor with weakly supervised training (ProbKT*)</td>
			</tr>
			<tr>
					<td>2024</td>
					<td><a href="https://doi.org/10.1186/s13321-024-00926-w">MolNexTR: a generalized deep learning model for molecular image recognition</a></td>
					<td><a href="/notes/chemistry/optical-structure-recognition/vision-language/molnextr/">MolNexTR Notes</a></td>
					<td>Dual-stream (ConvNext + ViT) encoder + Transformer decoder with graph generation</td>
			</tr>
			<tr>
					<td>2025</td>
					<td><a href="https://doi.org/10.1109/CVPR52734.2025.01352">MarkushGrapher: Joint Visual and Textual Recognition of Markush Structures</a></td>
					<td><a href="/notes/chemistry/optical-structure-recognition/markush/markushgrapher/">MarkushGrapher Notes</a></td>
					<td>UDOP VTL encoder + MolScribe OCSR encoder + T5 decoder with CXSMILES + substituent table</td>
			</tr>
			<tr>
					<td>2025</td>
					<td><a href="https://doi.org/10.48550/arXiv.2505.03777">MolMole: Molecule Mining from Scientific Literature</a></td>
					<td><a href="/notes/chemistry/optical-structure-recognition/image-to-graph/molmole/">MolMole Notes</a></td>
					<td>ViDetect (DINO) + ViReact (RxnScribe) + ViMore (detection-based) unified page-level pipeline</td>
			</tr>
			<tr>
					<td>2025</td>
					<td><a href="https://doi.org/10.48550/arXiv.2501.15415">OCSU: Optical Chemical Structure Understanding for Molecule-centric Scientific Discovery</a></td>
					<td><a href="/notes/chemistry/optical-structure-recognition/vision-language/ocsu/">OCSU Notes</a></td>
					<td>DoubleCheck: MolScribe + attentive feature enhancement with local ambiguous atom refinement</td>
			</tr>
	</tbody>
</table>
<h3 id="image-to-fingerprint-paradigm">Image-to-Fingerprint Paradigm</h3>
<p>Methods that bypass molecular graph reconstruction entirely, generating molecular fingerprints directly from images through functional group recognition and spatial analysis. These approaches prioritize retrieval and similarity search over exact structure reconstruction.</p>
<table>
	<thead>
			<tr>
					<th>Year</th>
					<th>Paper</th>
					<th>Notes</th>
					<th>Architecture</th>
			</tr>
	</thead>
	<tbody>
			<tr>
					<td>2025</td>
					<td><a href="https://doi.org/10.1186/s13321-025-01091-4">SubGrapher: visual fingerprinting of chemical structures</a></td>
					<td><a href="/notes/chemistry/optical-structure-recognition/vision-language/subgrapher/">SubGrapher Notes</a></td>
					<td>Dual Mask-RCNN instance segmentation (1,534 groups + 27 backbones) + substructure-graph + SVMF fingerprint</td>
			</tr>
	</tbody>
</table>
<h3 id="image-classification-and-filtering">Image Classification and Filtering</h3>
<p>Methods that classify chemical structure images for preprocessing purposes, such as detecting Markush structures or other problematic inputs that should be filtered before full OCSR processing.</p>
<table>
	<thead>
			<tr>
					<th>Year</th>
					<th>Paper</th>
					<th>Notes</th>
					<th>Architecture</th>
			</tr>
	</thead>
	<tbody>
			<tr>
					<td>2023</td>
					<td><a href="https://doi.org/10.48550/arXiv.2311.14633">One Strike, You&rsquo;re Out: Detecting Markush Structures in Low Signal-to-Noise Ratio Images</a></td>
					<td><a href="/notes/chemistry/optical-structure-recognition/markush/jurriaans-markush-detection-2023/">Jurriaans et al. Notes</a></td>
					<td>Patch-based pipeline with Inception V3 or ResNet18 for binary classification</td>
			</tr>
	</tbody>
</table>
<h2 id="traditional-machine-learning-methods">Traditional Machine Learning Methods</h2>
<p>Hybrid approaches combining classical machine learning algorithms (neural networks, SVMs, CRFs) with domain-specific heuristics and image processing. These methods (primarily from 1992-2014) used ML for specific subtasks like character recognition or symbol classification while relying on rule-based systems for chemical structure interpretation.</p>
<table>
	<thead>
			<tr>
					<th>Year</th>
					<th>Paper</th>
					<th>Notes</th>
					<th>Key ML Component</th>
			</tr>
	</thead>
	<tbody>
			<tr>
					<td>1992</td>
					<td><a href="https://doi.org/10.1021/ci00008a018">Kekulé: OCR-Optical Chemical (Structure) Recognition</a></td>
					<td><a href="/notes/chemistry/optical-structure-recognition/rule-based/kekule-1992/">Kekulé Notes</a></td>
					<td>Multilayer perceptron for OCR</td>
			</tr>
			<tr>
					<td>1996</td>
					<td><a href="https://doi.org/10.1007/3-540-61226-2_14">Automatic Interpretation of Chemical Structure Diagrams</a></td>
					<td><a href="/notes/chemistry/optical-structure-recognition/rule-based/kekule-1996/">Kekulé-1 Notes</a></td>
					<td>Neural network with shared weights (proto-CNN)</td>
			</tr>
			<tr>
					<td>2007</td>
					<td><a href="https://cdn.aaai.org/AAAI/2007/AAAI07-134.pdf">Recognition of Hand Drawn Chemical Diagrams</a></td>
					<td><a href="/notes/chemistry/optical-structure-recognition/hand-drawn/ouyang-davis-aaai-2007/">Ouyang-Davis Notes</a></td>
					<td>SVM for symbol classification</td>
			</tr>
			<tr>
					<td>2008</td>
					<td><a href="https://static.aminer.org/pdf/PDF/000/295/640/neural_versus_syntactic_recognition_of_handwritten_numerals.pdf">Chemical Ring Handwritten Recognition Based on Neural Networks</a></td>
					<td><a href="/notes/chemistry/optical-structure-recognition/hand-drawn/hewahi-ring-recognition-2008/">Hewahi et al. Notes</a></td>
					<td>Two-phase classifier-recognizer with feed-forward NNs</td>
			</tr>
			<tr>
					<td>2008</td>
					<td><a href="https://doi.org/10.1109/IJCNN.2008.4634125">Recognition of On-line Handwritten Chemical Expressions</a></td>
					<td><a href="/notes/chemistry/optical-structure-recognition/online-recognition/yang-online-handwritten-2008/">Yang et al. Notes</a></td>
					<td>Two-level algorithm with edit distance matching</td>
			</tr>
			<tr>
					<td>2008</td>
					<td><a href="https://doi.org/10.1109/ICPR.2008.4761824">A Study of On-Line Handwritten Chemical Expressions Recognition</a></td>
					<td><a href="/notes/chemistry/optical-structure-recognition/online-recognition/yang-icpr-2008/">Yang et al. Notes</a></td>
					<td>ANN with two-level substance recognition</td>
			</tr>
			<tr>
					<td>2009</td>
					<td><a href="https://doi.org/10.1109/ICDAR.2009.64">A Unified Framework for Recognizing Handwritten Chemical Expressions</a></td>
					<td><a href="/notes/chemistry/optical-structure-recognition/online-recognition/chang-unified-framework-2009/">Chang et al. Notes</a></td>
					<td>GMM for spatial relations, NN for bond verification</td>
			</tr>
			<tr>
					<td>2009</td>
					<td><a href="https://doi.org/10.1109/ICDAR.2009.99">HMM-Based Online Recognition of Handwritten Chemical Symbols</a></td>
					<td><a href="/notes/chemistry/optical-structure-recognition/online-recognition/zhang-hmm-handwriting-2009/">Zhang et al. Notes</a></td>
					<td>Hidden Markov Model for online handwriting</td>
			</tr>
			<tr>
					<td>2009</td>
					<td><a href="https://doi.org/10.1109/ICDAR.2009.70">The Understanding and Structure Analyzing for Online Handwritten Chemical Formulas</a></td>
					<td><a href="/notes/chemistry/optical-structure-recognition/online-recognition/wang-online-handwritten-2009/">Wang et al. Notes</a></td>
					<td>HMM for text recognition + CFG for structure parsing</td>
			</tr>
			<tr>
					<td>2010</td>
					<td><a href="https://doi.org/10.1109/ICPR.2010.465">A SVM-HMM Based Online Classifier for Handwritten Chemical Symbols</a></td>
					<td><a href="/notes/chemistry/optical-structure-recognition/online-recognition/zhang-svm-hmm-2010/">Zhang et al. Notes</a></td>
					<td>Dual-stage SVM-HMM with PSR algorithm</td>
			</tr>
			<tr>
					<td>2011</td>
					<td><a href="https://doi.org/10.1145/1943403.1943444">ChemInk: A Natural Real-Time Recognition System for Chemical Drawings</a></td>
					<td><a href="/notes/chemistry/optical-structure-recognition/online-recognition/chemink-2011/">ChemInk Notes</a></td>
					<td>Conditional Random Field (CRF) joint model</td>
			</tr>
			<tr>
					<td>2013</td>
					<td><a href="https://doi.org/10.1109/ICIS.2013.6607894">Online Chemical Symbol Recognition for Handwritten Chemical Expression Recognition</a></td>
					<td><a href="/notes/chemistry/optical-structure-recognition/online-recognition/tang-online-symbol-2013/">Tang et al. Notes</a></td>
					<td>SVM with elastic matching for handwriting</td>
			</tr>
			<tr>
					<td>2014</td>
					<td><a href="https://doi.org/10.1021/ci5002197">Markov Logic Networks for Optical Chemical Structure Recognition</a></td>
					<td><a href="/notes/chemistry/optical-structure-recognition/rule-based/mlocsr/">MLOCSR Notes</a></td>
					<td>Markov Logic Network for probabilistic inference</td>
			</tr>
	</tbody>
</table>
<h2 id="rule-based-methods">Rule-Based Methods</h2>
<p>Classic approaches using heuristics, image processing, and domain-specific rules. While some systems use traditional OCR engines (which may contain ML components), the chemical structure recognition itself is purely algorithmic.</p>
<p><strong>Note</strong>: The chemoCR systems use SVM-based OCR but employ rule-based topology-preserving vectorization for core structure reconstruction, placing them primarily in this category.</p>
<h3 id="core-methods">Core Methods</h3>
<table>
	<thead>
			<tr>
					<th>Year</th>
					<th>Paper</th>
					<th>Notes</th>
			</tr>
	</thead>
	<tbody>
			<tr>
					<td>1990</td>
					<td><a href="https://doi.org/10.1021/ci00067a014">Computational Perception and Recognition of Digitized Molecular Structures</a></td>
					<td><a href="/notes/chemistry/optical-structure-recognition/rule-based/contreras-ocr-1990/">Contreras et al. Notes</a></td>
			</tr>
			<tr>
					<td>1993</td>
					<td><a href="https://doi.org/10.1021/ci00013a010">Chemical Literature Data Extraction: The CLiDE Project</a></td>
					<td><a href="/notes/chemistry/optical-structure-recognition/rule-based/clide-1993/">CLiDE Notes</a></td>
			</tr>
			<tr>
					<td>1993</td>
					<td><a href="https://doi.org/10.1109/ICDAR.1993.395658">Optical Recognition of Chemical Graphics</a></td>
					<td><a href="/notes/chemistry/optical-structure-recognition/rule-based/casey-ocsr-1993/">Casey et al. Notes</a></td>
			</tr>
			<tr>
					<td>1999</td>
					<td><a href="https://doi.org/10.1109/ICDAR.1999.791730">Automatic Reading of Handwritten Chemical Formulas from a Structural Representation of the Image</a></td>
					<td><a href="/notes/chemistry/optical-structure-recognition/hand-drawn/ramel-handwritten-1999/">Ramel et al. Notes</a></td>
			</tr>
			<tr>
					<td>2007</td>
					<td><a href="https://doi.org/10.1109/ENC.2007.25">Automatic Recognition of Chemical Images</a></td>
					<td><a href="/notes/chemistry/optical-structure-recognition/rule-based/algorri-chemical-image-recognition-2007/">chemoCR Notes</a></td>
			</tr>
			<tr>
					<td>2007</td>
					<td><a href="https://doi.org/10.1109/IEMBS.2007.4353366">Reconstruction of Chemical Molecules from Images</a></td>
					<td><a href="/notes/chemistry/optical-structure-recognition/rule-based/algorri-reconstruction-2007/">chemoCR Notes</a></td>
			</tr>
			<tr>
					<td>2009</td>
					<td><a href="https://doi.org/10.1186/1752-153X-3-4">Automated extraction of chemical structure information from digital raster images</a></td>
					<td><a href="/notes/chemistry/optical-structure-recognition/rule-based/chemreader-2009/">ChemReader Notes</a></td>
			</tr>
			<tr>
					<td>2009</td>
					<td><a href="https://doi.org/10.1021/ci800449t">CLiDE Pro: The Latest Generation of CLiDE, a Tool for Optical Chemical Structure Recognition</a></td>
					<td><a href="/notes/chemistry/optical-structure-recognition/rule-based/clide-pro-2009/">CLiDE Pro Notes</a></td>
			</tr>
			<tr>
					<td>2009</td>
					<td><a href="https://doi.org/10.1021/ci800067r">Optical Structure Recognition Software To Recover Chemical Information: OSRA, An Open Source Solution</a></td>
					<td><a href="/notes/chemistry/optical-structure-recognition/rule-based/osra/">OSRA Notes</a></td>
			</tr>
			<tr>
					<td>2012</td>
					<td><a href="https://doi.org/10.1117/12.912185">Chemical Structure Recognition: A Rule Based Approach</a></td>
					<td><a href="/notes/chemistry/optical-structure-recognition/rule-based/molrec-2012/">MolRec Notes</a></td>
			</tr>
			<tr>
					<td>2015</td>
					<td><a href="https://doi.org/10.2991/jimet-15.2015.50">Research on Chemical Expression Images Recognition</a></td>
					<td><a href="/notes/chemistry/optical-structure-recognition/rule-based/hong-chemical-expression-2015/">Hong et al. Notes</a></td>
			</tr>
	</tbody>
</table>
<h3 id="trec-2011-chemistry-track">TREC 2011 Chemistry Track</h3>
<p>The <a href="/notes/chemistry/optical-structure-recognition/benchmarks/trec-chem-2011/">TREC 2011 Chemistry Track</a> provided a standardized benchmark for comparing OCSR systems, introducing the novel Image-to-Structure task alongside Prior Art and Technology Survey tasks. Papers from this evaluation are grouped here.</p>
<table>
	<thead>
			<tr>
					<th>System</th>
					<th>Paper</th>
					<th>Notes</th>
			</tr>
	</thead>
	<tbody>
			<tr>
					<td>chemoCR</td>
					<td><a href="https://trec.nist.gov/pubs/trec20/papers/chemoCR.chem.update.pdf">Chemical Structure Reconstruction with chemoCR</a></td>
					<td><a href="/notes/chemistry/optical-structure-recognition/benchmarks/chemocr-trec-2011/">chemoCR Notes</a></td>
			</tr>
			<tr>
					<td>ChemReader</td>
					<td><a href="https://trec.nist.gov/pubs/trec20/papers/chemreader.chem.update.pdf">Image-to-Structure Task by ChemReader</a></td>
					<td><a href="/notes/chemistry/optical-structure-recognition/benchmarks/chemreader-trec-2011/">ChemReader at TREC 2011 Notes</a></td>
			</tr>
			<tr>
					<td>Imago</td>
					<td><a href="https://trec.nist.gov/pubs/trec20/papers/GGA.chemical.pdf">Imago: open-source toolkit for 2D chemical structure image recognition</a></td>
					<td><a href="/notes/chemistry/optical-structure-recognition/benchmarks/imago-trec-2011/">Imago Notes</a></td>
			</tr>
			<tr>
					<td>OSRA</td>
					<td><a href="https://trec.nist.gov/pubs/trec20/papers/saic-frederick.chem.pdf">Optical Structure Recognition Application entry in Image2Structure task</a></td>
					<td><a href="/notes/chemistry/optical-structure-recognition/benchmarks/osra-trec-2011/">OSRA at TREC 2011 Notes</a></td>
			</tr>
			<tr>
					<td>MolRec</td>
					<td><a href="https://trec.nist.gov/pubs/trec20/papers/UoB.chem.update.pdf">Performance of MolRec at TREC 2011 Overview and Analysis of Results</a></td>
					<td><a href="/notes/chemistry/optical-structure-recognition/benchmarks/molrec_at_trec/">MolRec at TREC Notes</a></td>
			</tr>
			<tr>
					<td>ChemInfty</td>
					<td><a href="https://www.inftyreader.org/inftyreader-contents/about-inftyreader/list-of-academic-papers/2011_GREC_ChemInfty.pdf">Robust Method of Segmentation and Recognition of Chemical Structure Images in ChemInfty</a></td>
					<td><a href="/notes/chemistry/optical-structure-recognition/rule-based/cheminfty/">ChemInfty Notes</a></td>
			</tr>
	</tbody>
</table>
<h3 id="clef-2012-chemistry-track">CLEF 2012 Chemistry Track</h3>
<p>The <a href="/notes/chemistry/optical-structure-recognition/benchmarks/clef-ip-2012/">CLEF-IP 2012 benchmarking lab</a> introduced three specific IR tasks in the intellectual property domain: claims-based passage retrieval, flowchart recognition, and chemical structure recognition. The chemical structure recognition task included both segmentation (identifying bounding boxes) and recognition (converting to MOL format) subtasks, with a particular focus on challenging Markush structures common in patents.</p>
<table>
	<thead>
			<tr>
					<th>System</th>
					<th>Paper</th>
					<th>Notes</th>
			</tr>
	</thead>
	<tbody>
			<tr>
					<td>MolRec</td>
					<td><a href="https://ceur-ws.org/Vol-1178/CLEF2012wn-CLEFIP-SadawiEt2012.pdf">MolRec at CLEF 2012 - Overview and Analysis of Results</a></td>
					<td><a href="/notes/chemistry/optical-structure-recognition/benchmarks/molrec-clef-2012/">MolRec at CLEF 2012 Notes</a></td>
			</tr>
			<tr>
					<td>OSRA</td>
					<td><a href="https://ceur-ws.org/Vol-1178/CLEF2012wn-CLEFIP-FilippovEt2012.pdf">Optical Structure Recognition Application entry to CLEF-IP 2012</a></td>
					<td><a href="/notes/chemistry/optical-structure-recognition/benchmarks/osra-clef-2012/">OSRA at CLEF-IP 2012 Notes</a></td>
			</tr>
	</tbody>
</table>
]]></content:encoded></item><item><title>AI &amp; Physical Sciences Taxonomy: A Seven-Vector Framework</title><link>https://hunterheidenreich.com/notes/research-methods/ai-physical-sciences-paper-taxonomy/</link><pubDate>Sat, 13 Dec 2025 00:00:00 +0000</pubDate><guid>https://hunterheidenreich.com/notes/research-methods/ai-physical-sciences-paper-taxonomy/</guid><description>Seven-vector framework for classifying research papers at the nexus of AI and physical sciences by dominant contribution type.</description><content:encoded><![CDATA[<h2 id="overview">Overview</h2>
<p>This is a personal working taxonomy, a lens I use to orient myself when reading papers, not a formal classification scheme. The categories are fuzzy in practice, and reasonable people will assign the same paper differently. The goal is clarity of thought, not consensus.</p>
<p>The taxonomy uses a <strong>superposition model</strong> where each paper is viewed as a linear combination of seven fundamental contribution types (basis vectors). Examples throughout draw primarily from chemistry and materials science, though the framework applies across physical sciences.</p>
<p>The framework helps answer: &ldquo;What is this paper&rsquo;s primary contribution?&rdquo; by identifying rhetorical patterns and structural elements that signal different research paradigms.</p>
<h2 id="core-principle-the-superposition-model">Core Principle: The Superposition Model</h2>
<p>All papers in this domain can be viewed as a <strong>superposition</strong> of fundamental contribution vectors. This is an analogy, not a formal mathematical claim: the seven types below are not linearly independent in the strict sense, and most papers project onto more than one.</p>
<p>Most papers exhibit a <strong>profile</strong> across multiple basis vectors, blending contribution types (e.g., Method + Theory). One vector usually provides the primary narrative thrust; secondary vectors supply the supporting evidence.</p>
<p>I tend to classify a paper by identifying its <strong>Primary Projection</strong> (the dominant contribution) and <strong>Secondary Projections</strong> (supporting work). When a paper seems to split evenly across two types, I look at which type&rsquo;s indicators dominate the abstract and section headings, and I treat the secondary projection as context that supports the primary narrative, not a co-equal claim.</p>
<h2 id="the-seven-basis-vectors-psi">The Seven Basis Vectors ($\Psi$)</h2>
<table>
	<thead>
			<tr>
					<th style="text-align: left">Basis Vector</th>
					<th style="text-align: left">Alias/Focus</th>
					<th style="text-align: left">Core Question</th>
					<th style="text-align: left">Primary Output</th>
			</tr>
	</thead>
	<tbody>
			<tr>
					<td style="text-align: left"><strong>1. $\Psi_{\text{Method}}$</strong></td>
					<td style="text-align: left">The Methodological Basis (Architecture/Algorithm)</td>
					<td style="text-align: left"><strong>What new mechanism does this introduce?</strong></td>
					<td style="text-align: left">New algorithm, architecture, or approximation</td>
			</tr>
			<tr>
					<td style="text-align: left"><strong>2. $\Psi_{\text{Theory}}$</strong></td>
					<td style="text-align: left">The Theoretical Basis (Formal Analysis)</td>
					<td style="text-align: left"><strong>Why does this work?</strong></td>
					<td style="text-align: left">Formal proof, generalization bound, or physical derivation</td>
			</tr>
			<tr>
					<td style="text-align: left"><strong>3. $\Psi_{\text{Resource}}$</strong></td>
					<td style="text-align: left">The Infrastructure Basis (Data/Software)</td>
					<td style="text-align: left"><strong>What resources are available?</strong></td>
					<td style="text-align: left">Dataset, benchmark, or open-source software ecosystem</td>
			</tr>
			<tr>
					<td style="text-align: left"><strong>4. $\Psi_{\text{Systematization}}$</strong></td>
					<td style="text-align: left">The Review Basis (Synthesis)</td>
					<td style="text-align: left"><strong>What do we know?</strong></td>
					<td style="text-align: left">Comprehensive survey or new organizing taxonomy (Systematization of Knowledge, SoK)</td>
			</tr>
			<tr>
					<td style="text-align: left"><strong>5. $\Psi_{\text{Position}}$</strong></td>
					<td style="text-align: left">The Sociological Basis (Perspective)</td>
					<td style="text-align: left"><strong>Where should the field go?</strong></td>
					<td style="text-align: left">Opinion piece, perspective, or critique of community practice</td>
			</tr>
			<tr>
					<td style="text-align: left"><strong>6. $\Psi_{\text{Discovery}}$</strong></td>
					<td style="text-align: left">The Empirical Discovery Basis</td>
					<td style="text-align: left"><strong>What new thing did we find?</strong></td>
					<td style="text-align: left">Experimentally or computationally validated material, molecule, or physical phenomenon</td>
			</tr>
			<tr>
					<td style="text-align: left"><strong>7. $\Psi_{\text{Application}}$</strong></td>
					<td style="text-align: left">The Transfer Basis (Domain Application)</td>
					<td style="text-align: left"><strong>Does this approach work here?</strong></td>
					<td style="text-align: left">Empirical evaluation of an existing method in a new scientific domain</td>
			</tr>
	</tbody>
</table>
<h2 id="assessment-guide-rhetorical-indicators">Assessment Guide: Rhetorical Indicators</h2>
<p>These rhetorical patterns tend to signal which vector dominates. They are heuristics, not rules; the goal is to notice what the paper is primarily arguing for, not to tick boxes.</p>
<h3 id="1-psi_textmethod-the-methodological-paper">1. $\Psi_{\text{Method}}$: The Methodological Paper</h3>
<p>Focuses on proposing a <strong>novel</strong> mechanism, architecture, or approximation (e.g., a new Transformer variant, a GNN with symmetry, a new DFT functional).</p>
<p><strong>Rhetorical Indicators:</strong></p>
<ul>
<li><strong>Ablation Study:</strong> Authors systematically remove components of their system to prove their specific innovation drives the performance gain. In physics venues, this often appears as parameter sensitivity analysis or direct comparison to prior potentials and functionals rather than a classic ablation table.</li>
<li><strong>Baseline Comparison:</strong> A prominent table comparing the new method against the <strong>State-of-the-Art (SOTA)</strong></li>
<li><strong>Pseudo-code:</strong> An explicit block detailing the algorithmic steps (e.g., for training, sampling, or inference)</li>
</ul>
<p><strong>Examples in the notes:</strong> <a href="/notes/machine-learning/generative-models/flow-matching-for-generative-modeling/">Flow Matching for Generative Modeling</a> (introduces a new continuous normalizing flow mechanism with ablations), <a href="/notes/chemistry/molecular-simulation/ml-potentials/mofflow/">MOFFlow</a> (novel SE(3) flow matching architecture for metal-organic frameworks with SOTA comparisons).</p>
<h3 id="2-psi_texttheory-the-theoretical-paper">2. $\Psi_{\text{Theory}}$: The Theoretical Paper</h3>
<p>Focuses on mathematical guarantees, proofs, or derivations from first principles.</p>
<p><strong>Rhetorical Indicators:</strong></p>
<ul>
<li><strong>Mathematical Proof Sections:</strong> Sections titled &ldquo;Theorem 1,&rdquo; &ldquo;Proof of Equivariance,&rdquo; or &ldquo;Formal Bounds&rdquo;</li>
<li><strong>Analysis of Limits/Capacity:</strong> Investigates the <strong>expressivity</strong> (e.g., comparing a GNN to the Weisfeiler-Lehman Test) or analyzes the geometry of the optimization landscape</li>
<li><strong>Generalization/OOD:</strong> Derives <strong>generalization bounds</strong> on test error or formally defines &ldquo;chemical space coverage&rdquo; for out-of-distribution (OOD) behavior</li>
<li><strong>Exact Constraints:</strong> Derives exact conditions that true physical functions (like the universal Density Functional) must satisfy</li>
</ul>
<p><strong>Examples in the notes:</strong> <a href="/notes/machine-learning/generative-models/convexity-principle-interacting-gases/">The Convexity Principle and Interacting Gases</a> (formal theoretical analysis connecting flow-based generative models to thermodynamic principles).</p>
<h3 id="3-psi_textresource-the-infrastructure-paper">3. $\Psi_{\text{Resource}}$: The Infrastructure Paper</h3>
<p>Focuses on creating and sharing foundational tools for the community.</p>
<p><strong>Rhetorical Indicators:</strong></p>
<ul>
<li><strong>Curation Description:</strong> Detailed steps on how data was generated, filtered, or curated (e.g., describing millions of CPU-hours of DFT calculations for a dataset like QM9). In physics contexts, this often takes the form of DFT protocol descriptions and computational settings rather than a formal &ldquo;datasheet.&rdquo;</li>
<li><strong>&ldquo;Datasheets&rdquo; and &ldquo;Data Cards&rdquo;:</strong> Inclusion of formal documentation detailing provenance, copyright, and potential biases in the data. In physics contexts, this often appears as detailed computational settings, DFT functional choices, and convergence criteria rather than a named datasheet document.</li>
<li><strong>Benchmark Definition:</strong> Argues that &ldquo;Metric X on Dataset Y&rdquo; is the correct proxy for progress in a specific scientific task</li>
</ul>
<p><strong>Examples in the notes:</strong> <a href="/notes/chemistry/molecular-design/generation/evaluation/molecular-sets-moses/">Molecular Sets (MOSES)</a> (releases a benchmark dataset and evaluation suite for molecular generation), <a href="/notes/chemistry/molecular-representations/notations/selfies-2023/">SELFIES 2023</a> (releases an updated molecular string representation standard with tooling and validation).</p>
<h3 id="4-psi_textsystematization-the-review-paper">4. $\Psi_{\text{Systematization}}$: The Review Paper</h3>
<p>Focuses on organizing and synthesizing existing literature.</p>
<p><strong>Rhetorical Indicators:</strong></p>
<ul>
<li><strong>Survey Structure:</strong> Follows a linear, often chronological, progression or is grouped by architecture (e.g., Variational Autoencoders (VAEs), GANs, Diffusion models)</li>
<li><strong>Systematization of Knowledge (SoK):</strong> A higher-order contribution that proposes a <strong>new taxonomy or a unified framework</strong> to connect disparate concepts</li>
<li><strong>Citation Density:</strong> References a large fraction of the relevant prior literature; often includes a comparison table spanning many prior works across years or venues</li>
</ul>
<p><strong>Examples in the notes:</strong> <a href="/notes/chemistry/molecular-simulation/classical-methods/embedded-atom-method-review-1993/">Embedded Atom Method Review (1993)</a> (organizes and contextualizes the body of work on EAM potentials into a coherent reference).</p>
<h3 id="5-psi_textposition-the-sociological-paper">5. $\Psi_{\text{Position}}$: The Sociological Paper</h3>
<p>Focuses on meta-science, arguing for a change in community norms, or critiquing systemic issues.</p>
<p>I see two subtypes come up often. The first is the <strong>roadmap/perspective</strong> paper: a constructive argument for where the field should focus, often written by senior researchers after a period of reflection. The second is the <strong>critique</strong> paper: a more adversarial argument that something the community is currently doing is wrong or counterproductive. Both share the same core signal (the argument itself is the contribution), but they have different tones and are often targeted at different audiences.</p>
<p><strong>Rhetorical Indicators:</strong></p>
<ul>
<li><strong>Venue/Track:</strong> Often found in &ldquo;Position Tracks&rdquo; or called &ldquo;Blue Sky&rdquo; or &ldquo;Forward Looking&rdquo; papers</li>
<li><strong>Argumentative Tone:</strong> Uses qualitative or quantitative analysis (meta-analysis) to argue for a shift in how research is conducted or funded (e.g., a paper arguing that AI contracts the focus of science)</li>
<li><strong>Argument as Contribution:</strong> The paper presents no new experimental findings; the primary contribution is the argument itself</li>
</ul>
<p><strong>Examples in the notes:</strong> <a href="/notes/computational-biology/fold-graciously/">Fold Graciously</a> (position paper arguing for a shift in how the protein folding community evaluates progress), <a href="/notes/chemistry/molecular-representations/notations/selfies-2022/">SELFIES 2022</a> (makes a normative argument for adopting SELFIES over SMILES for robust molecular generation; the paper also has Method and Resource characteristics, but the argument-first framing and advocacy tone push it toward Position for me).</p>
<h3 id="6-psi_textdiscovery-the-empirical-discovery-paper">6. $\Psi_{\text{Discovery}}$: The Empirical Discovery Paper</h3>
<p>Focuses on the discovery of novel scientific artifacts using AI/ML tools. The key criterion is experimental or higher-fidelity confirmation of the AI&rsquo;s prediction (wet-lab synthesis, physical characterization, or a higher-fidelity simulation), rather than performance on a held-out test set.</p>
<p><strong>Rhetorical Indicators:</strong></p>
<ul>
<li><strong>Structure:</strong> Follows a workflow: (1) Computational Screening (AI selects candidates), (2) <strong>Validation</strong> (wet-lab synthesis, physical characterization, or independent computational confirmation)</li>
<li><strong>Core Claim:</strong> The primary contribution is a <strong>new material, molecule, or physical finding</strong>, with the AI/ML part serving as the necessary first step</li>
<li><strong>Key Question:</strong> Does the AI&rsquo;s prediction hold true against an independent ground truth (e.g., a physical experiment or a higher-fidelity simulation)?</li>
</ul>
<p><strong>Examples in the notes:</strong> <a href="/notes/chemistry/molecular-simulation/surface-science/oxidation-reduction-oscillations-pt-sio2-1994/">Oxidation-Reduction Oscillations on Pt/SiO2 (1994)</a> (validates a computationally-predicted dynamic phenomenon against physical experiment).</p>
<h3 id="7-psi_textapplication-the-application-paper">7. $\Psi_{\text{Application}}$: The Application Paper</h3>
<p>Applies an existing method, architecture, or technique to a new scientific domain or task without introducing a new mechanism, dataset, or experimentally confirmed finding. The primary contribution is demonstrating feasibility or utility of transfer.</p>
<p><strong>Rhetorical Indicators:</strong></p>
<ul>
<li><strong>&ldquo;We Apply X to Y&rdquo; framing:</strong> The abstract explicitly names an existing method and a new domain; the contribution is the connection, not the method itself.</li>
<li><strong>Benchmark-style Results:</strong> Performance reported on domain-specific tasks using existing metrics; baselines are often simple (classical methods, prior domain tools) rather than ML SOTA.</li>
<li><strong>Absence of novelty claims:</strong> The paper does not argue for a new architecture, does not release a new dataset, and does not report a validated experimental discovery.</li>
</ul>
<p><strong>Examples in the notes:</strong> <a href="/notes/chemistry/llm-applications/benchmarking-llms-molecule-prediction/">Benchmarking LLMs for Molecular Property Prediction</a> (evaluates GPT-3.5, GPT-4, and Llama-2 on six existing OGB molecular tasks without modifying the models), <a href="/notes/chemistry/molecular-design/property-prediction/maxsmi-smiles-augmentation-property-prediction/">Maxsmi: SMILES Augmentation for Property Prediction</a> (systematic evaluation of five augmentation strategies with existing CNN/RNN architectures), <a href="/notes/chemistry/molecular-design/generation/evaluation/molecular-language-models-rnns-or-transformer/">RNNs vs Transformers for Molecular Generation Tasks</a> (empirical comparison of existing architectures on SMILES and SELFIES generation).</p>
<h2 id="edge-cases-and-disambiguation">Edge Cases and Disambiguation</h2>
<p>These are the pairs I find myself second-guessing most often. I&rsquo;ve written down how I tend to resolve them, not as rules, but as a record of my reasoning.</p>
<p><strong>Method vs. Discovery:</strong> The key question I ask is whether there is independent validation beyond a held-out test set. If the paper reports a wet-lab confirmation or a higher-fidelity simulation verifying the AI&rsquo;s output, I lean toward Discovery: the finding is real and the AI was the tool. If the architecture is the thing being argued for, and validation is limited to benchmarks, I lean toward Method. One edge case I see often in computational chemistry is ML-predicts + DFT-validates: no wet lab, but DFT is genuinely independent of the ML model. I treat this as Discovery if the DFT result is the claimed contribution, and Method if the ML model&rsquo;s performance against DFT is what&rsquo;s being argued for.</p>
<p><strong>Resource vs. Systematization:</strong> I think of this as artifact-first vs. interpretation-first. If the paper&rsquo;s main output is something you can download and use (a benchmark, a curated dataset, a software library), it&rsquo;s Resource. If the paper&rsquo;s main output is a new way of thinking about a body of literature (a taxonomy, a conceptual unification), it&rsquo;s Systematization. The presence of a clear benchmark definition with metrics tends to push toward Resource even when there is substantial review content.</p>
<p><strong>Application vs. Method:</strong> The cleanest distinguisher here is whether anything new was designed. If an existing method is taken off the shelf and pointed at a new domain, that&rsquo;s Application. If the domain&rsquo;s requirements motivated a modification to the method (even a small one), then there may be a legitimate Method component. Application papers often read as feasibility demonstrations; Method papers read as capability expansions.</p>
<p><strong>When I&rsquo;m still stuck:</strong> I look at three things in roughly this order: the abstract&rsquo;s final sentence (in my experience, especially in ML venues, authors tend to signal what they most want credit for in that last sentence), section heading vocabulary (presence of &ldquo;theorem,&rdquo; &ldquo;algorithm,&rdquo; &ldquo;dataset,&rdquo; &ldquo;survey,&rdquo; or &ldquo;we find&rdquo; is usually diagnostic), and venue track (position/perspective tracks, SoK tracks, and empirical tracks each carry strong prior signal). I treat the result as a best guess, not a verdict.</p>
<h2 id="applications">Applications</h2>
<p>This framework has been useful to me in a few concrete ways:</p>
<ul>
<li><strong>Organizing literature reviews:</strong> Knowing a paper&rsquo;s vector profile tells me where it belongs in a review&rsquo;s structure: whether it fits in the &ldquo;methods&rdquo; or &ldquo;findings&rdquo; or &ldquo;community context&rdquo; section, rather than forcing everything into chronological order.</li>
<li><strong>Understanding conference and journal acceptance criteria:</strong> Different venues weight vectors differently. Physics journals favor Discovery; ML venues favor Method and Theory; interdisciplinary venues like <em>Nature</em> or <em>Science</em> often weight Discovery heavily but also publish high-impact Position papers. Knowing this helps calibrate expectations.</li>
<li><strong>Identifying gaps in research portfolios:</strong> A collection that is heavy on Method but light on Resource or Discovery points to work that may lack empirical grounding or shared infrastructure. The vector breakdown makes these gaps visible.</li>
<li><strong>Recognizing different types of scientific contribution:</strong> Not everything that looks like a methods paper is one, and not everything that looks like a survey is one. The rhetorical patterns here help me notice when my first impression was wrong and reconsider what is actually being claimed.</li>
</ul>
<h2 id="on-site-enforcement">On-Site Enforcement</h2>
<p>Every <code>note_type: paper</code> entry on this site declares its Primary Projection through a single-valued <code>paper_types</code> frontmatter list. A schema validator rejects notes that omit this field or use values outside the seven canonical vectors, and the classification is surfaced as a Hugo taxonomy at <a href="/paper-types/">/paper-types/</a>. Browsing a vector landing page such as <a href="/paper-types/method/">/paper-types/method/</a> or <a href="/paper-types/systematization/">/paper-types/systematization/</a> is the fastest way to pull up every note that shares a contribution type.</p>
<p>Enforcement is deliberately single-select: it captures the Primary Projection only. Secondary vectors still exist in the text of each note, but the tag axis is chosen to discriminate between classes rather than to describe a paper exhaustively.</p>
]]></content:encoded></item></channel></rss>