A Perfume Holds Hundreds of Molecules — How AI Picks Them Out One by One
The GC-MS fragrance deconvolution algorithm, from principle to deployment
I. Where the Problem Begins
You get your hands on someone else's fragrance oil. It smells great. The client asks: "Can you make me one just like it?"
The traditional approach is this: send it out for a GC-MS analysis, get back a report, then bring in a seasoned perfumer who sits with that report for 3 to 7 days and reverse-engineers a bench-ready formula sheet.
What that perfumer is doing is called, in the trade, "deconvolution." Meaning: reversing the spectrum back into a formula.
3 to 7 days is the industry floor. A typical compound fragrance may contain 80 to 150 chemical compounds, blending a dozen or so essential oils, dozens of synthetic monomers, and a few carrier solvents. The same molecule may come both from "linalool" inside lavender oil and from "pure linalool monomer" added on its own. The perfumer has to judge from experience: whom does this number belong to?
Can we let an algorithm do this step?
We can. But not the kind of "AI" you're imagining.
II. GC-MS Isn't the Answer — It's the Answer Sheet, Torn to Shreds
First, let's be clear about what GC-MS is.
Gas Chromatography–Mass Spectrometry. You inject the fragrance sample, and the instrument separates it into dozens to hundreds of chromatographic peaks, each peak corresponding to one molecule. The output looks roughly like this Excel sheet:
| No. | Retention Time | CAS No. | Compound Name | Area% |
|---|---|---|---|---|
| 1 | 4.32 | 78-70-6 | Linalool | 8.68 |
| 2 | 5.11 | 115-95-7 | Linalyl acetate | 3.60 |
| 3 | 6.89 | 105-37-3 | Ethyl propionate | 2.10 |
| ... | ... | ... | ... | ... |
| 126 | 22.41 | unknow | — | 0.22 |
A compound fragrance of the oud-agarwood family runs out to 126 rows.
Note one crucial fact: GC-MS gives you a "molecule-level inventory," not a "material-level formula."
What the perfumer actually needs is this kind of thing:
异构十二烷 80.46% ← 载体
芳樟醇 8.80% ← 纯单体
乙酸芳樟酯 3.60% ← 纯单体
二丙二醇甲醚 2.60% ← 溶剂
龙涎酮 1.55%
佳乐麝香 0.92%
... 共 24 行原料 ...
藿香油 0.10% ← 唯一精油
This is the "formula sheet" a compounder can take and weigh out ingredients from. Its granularity is material, not molecule.
GC-MS has torn the answer sheet into 126 scraps of paper. What the deconvolution algorithm does is piece those 126 scraps back into the original 24-row material manuscript.
Figure 1 · GC-MS gives a "molecule inventory," the perfumer wants a "material formula" — what deconvolution does is turn the left side into the right
III. Deconvolution Is Not Training, and It's Certainly Not a Large Model
Many people's first reaction is: "Just hand it to GPT, no?"
No. There are three reasons, each more important than the last:
① A large language model has never "smelled" a fragrance — all it has read is text. Even if you fed it every perfumery blog on the internet, it would only know surface-level knowledge like "linalool has a lavender note," not the quantitative structure of "one dose of lemon oil brings in 8% limonene."
② The GC-MS inversion is an inverse problem with a mathematical structure — it's not pattern recognition. In essence it is solving a set of linear equations — "given the measured percentages of 126 compounds, find how much of each of 30 candidate materials was added." This kind of problem has 50 years of statistical groundwork behind it, and traditional methods handle it cleanly. Deep learning, by contrast, would need paired "formula → GC-MS" data to train on, and in this industry that data is precisely the least likely thing to be made public — the formula itself is the lifeblood.
③ A large model will "make things up." It might tell you this bottle contains 5.2% nerolidol, when the GC-MS report has no such row at all. In a setting like perfumery, where even a ±1% deviation forces a re-sample, one fabrication scraps an entire batch of material.
| Approach | Suited to | Fit for this scenario? |
|---|---|---|
| Train an LLM | Teaching AI to understand language | Wrong fit, and it's not your call anyway |
| Fine-tune an LLM | Making AI learn a certain tone | Wrong fit — this isn't a language problem |
| Prompt a large model | Open-ended generation | Wrong fit — it will fabricate |
| Traditional numerical algorithm | Inverse problems with an equation structure | The right answer |
The deconvolution algorithm takes the fourth road. It isn't "clever," but it is "honest" — the part it can't solve, it leaves blank, and it never makes anything up.
IV. The Full Pipeline: From Spectrum to Formula
The entire deconvolution pipeline breaks into five stages:
| Stage | Input | Output | Key Technique |
|---|---|---|---|
| 1. Parsing | GC-MS Excel | Compound inventory | Multi-format xlsx parsing |
| 2. Classification | Compound inventory | Labels: essential oil / synthetic / solvent / unknown | CAS dictionary + name matching |
| 3. Normalization | Labeled inventory | De-solvent, normalize to 100% | Formulation convention |
| 4. Inversion | Normalized compounds | Candidate materials + amounts | Focus of this piece |
| 5. Table output | Candidate materials + amounts | Perfumer's ingredient sheet | Excel template |
The first three steps are engineering grunt work — nothing much to say about them. What's genuinely interesting is step 4 — the "inversion."
Step 4 itself splits into two layers:
- The easy layer: identifying "which essential oils were used in this bottle." The algorithm is called the anchoring method.
- The hard layer: splitting the measured amount of a single molecule into "X% from essential oil A, Y% from essential oil B, Z% added separately as pure monomer." The algorithm is NNLS + LASSO.
Let's take them one at a time.
Figure 2 · The five-stage deconvolution pipeline — the first three steps are engineering grunt work; step ④ "inversion" is the algorithm proper
V. Step One · The Anchoring Method: Find the Fingerprint First
Every essential oil has its own "fingerprint molecule."
| Essential Oil | Anchor Molecule | Typical Share in That Oil |
|---|---|---|
| Lavender oil | Linalool | ~35% |
| Patchouli oil | Patchoulol | ~30% |
| Cedarwood oil | α-cedrene | ~25% |
| Petitgrain oil | Linalyl acetate | ~50% |
| Black pepper oil | β-caryophyllene | ~22% |
The idea behind the anchoring method is plain: work backwards.
Here's an example. The GC-MS report measures patchoulol at 2.72%. This molecule appears almost exclusively in patchouli oil, at a typical share of 30%.
So:
配方里广藿香油的用量 ≈ 2.72% ÷ 30% ≈ 9.07%
Then you verify: do the measured amounts of the other characteristic molecules in patchouli oil (α-patchoulene, α-guaiene…) also match the carry-in ratio for 9.07%? If they match, HIGH confidence; if only half match, MEDIUM; if they don't match at all, either the amount was miscalculated or it isn't this essential oil in the first place.
This one step resolves about 80% of the problems in fragrance analysis. Once you can identify "there's 9% patchouli oil here, 6% cedarwood oil, 0.1% agarwood oil," the perfumer can start sampling right away.
Figure 3 · The anchoring method: measured patchoulol 2.72% ÷ typical share 30% ≈ inferred patchouli oil amount 9.07%
But the anchoring method has a hole — it can't tell "molecules carried in by an essential oil" from "pure monomers added on their own."
VI. Step Two · Dual-Signal Cross-Check: Making Counterfeit Oils Show Themselves
Back to that Sample No. 8 from the start.
The perfumer told us, off the record: "There's no petitgrain oil in this."
But the algorithm identified 7.54% petitgrain oil. Why?
The main components of petitgrain oil are linalool + linalyl acetate. The algorithm sees linalool at 8.8% and linalyl acetate at 3.6% in this bottle, works backwards, and arrives at "7.54% petitgrain oil."
But the truth is: linalool and linalyl acetate are both pure monomers added on their own — cheap, pure, in bulk. The algorithm mistook them for something "carried in by petitgrain oil."
This is a false positive. In a perfumery setting, a false positive is more dangerous than a miss — you sample against a bogus formula and the money is wasted.
The fix is to add a "dual-signal cross-check":
Signal ①: anchor dominance.
In a genuine essential oil, its anchor molecule should hold the highest share. In petitgrain oil, linalyl acetate (the anchor) is 50%, linalool is 30% — a ratio of 50:30. But in Sample No. 8, the measured linalyl acetate is 3.6% and linalool is 8.8% — the ratio is inverted; there's more linalool than the anchor. Such an inversion can only mean one thing: the linalool is externally added, not carried in by petitgrain oil. Veto it outright.
Signal ②: weighted failure rate.
If you've identified, say, 9% of some essential oil, then the measured amounts of all characteristic molecules in that oil should "match a 9% carry-in." Compare the expected and measured values of every characteristic molecule one by one, and compute a "failure rate" weighted by typical share. Failure rate above 70%, veto; between 50% and 70%, drop the confidence one notch.
With these two gates in place, the algorithm can finally no longer be fooled by pure monomers. The petitgrain oil false positive in Sample No. 8 was cleanly vetoed, and the genuine essential oils were kept.
This step looks unremarkable, but it is the one that pushes the system from "can spit out a report" to "can deliver to a client." The real moat is often not the main algorithm, but the "boundary detection around the main algorithm."
Figure 4 · The dual-signal cross-check stops the petitgrain oil false positive — Signal ① inverted anchor ratio + Signal ② weighted failure rate over threshold
VII. Step Three · A Gift from 1974: NNLS
The two steps above still only deal with "which essential oil, how much."
Now to the hardest problem: for a single molecule, how do you know which materials jointly contributed it?
Here's an example. This fragrance measures linalool at 8.8%. It could come from:
- 0.5% from lavender oil (bringing in 0.18%)
- 0.3% from neroli oil (bringing in 0.05%)
- 8.57% from pure linalool monomer added on its own
Or it could be:
- 0% carried in by essential oils
- 8.8% all pure monomer
This is the classic inverse problem: given "what the mixture looks like," find "how much of each material was added."
Written as an equation:
b = A · x
- b is the GC-MS measured vector (126 numbers, the area% of each compound)
- A is the "material–compound" contribution matrix (each column is one material's chemical fingerprint)
- x is the "amount of each material" to be solved for
If A were a square, invertible matrix, one line of linear algebra would solve it. The problem is:
- A is a rectangular matrix (126 compounds × ~30 candidate materials), which cannot be directly inverted.
- x must be non-negative (an amount can't be a negative number — this is physical common sense).
- The measurement itself carries error; b is imperfect.
In 1974, two mathematicians, Charles Lawson and Richard Hanson, wrote down an algorithm in their book Solving Least Squares Problems dedicated to solving this kind of "least squares problem with non-negativity constraints," called NNLS (Non-Negative Least Squares).
The algorithm itself is only a few dozen lines of code, but it has two things that move me:
First, it comes with a guarantee of an "exact solution." Not the neural-network kind of "trained until roughly converged," but a genuine, mathematically proven convergence to the optimal solution in a finite number of steps.
Second, it has crossed half a century. From its invention in 1974 to today — from chemometrics to spectral deconvolution, medical imaging, seismology, astronomy — every problem of "known observations, solve for source proportions, and the proportions cannot be negative" has this at its back.
When you write scipy.optimize.nnls(A, b) in Python today, what you're calling is Lawson-Hanson 1974.
Fragrance deconvolution takes it and uses it as-is. It belongs to no single programmer; it belongs to half a century of accumulated statistics.
VIII. Step Four · A Revolution from 1996: LASSO
NNLS solved "non-negativity," but there's still one unsolved problem: sparsity.
In reality, a fragrance uses at most 20–30 materials. But the candidate library holds thousands of materials.
If you run NNLS directly, it tends to "spread the amounts evenly" — giving a little bit to each material. The answer it hands you might be 800 materials each at 0.1%. In theory the residual is minimized; in practice it's unusable.
In 1996, Stanford statistician Robert Tibshirani gave an elegant solution in a paper — Regression Shrinkage and Selection via the Lasso — that has been cited nearly 100,000 times to this day.
LASSO stands for Least Absolute Shrinkage and Selection Operator. It adds an L1 penalty term to the least-squares objective function:
minimize ‖Ax - b‖² + λ · ‖x‖₁
That last term, ‖x‖₁, is the sum of the absolute values of all components of x. The larger the coefficient λ, the harsher the penalty, and the more variables get squeezed to 0.
The magic of LASSO is: it will automatically squeeze the vast majority of variables to exactly 0, leaving only the few that truly "contribute."
This is exactly what we want.
| Algorithm | Problem Solved | Role in Fragrance Deconvolution |
|---|---|---|
| NNLS (1974) | Amounts can't be negative | Physical constraint |
| LASSO (1996) | Only a few materials may be used | Sparsity prior |
Put the two together — NNLS guaranteeing non-negativity, LASSO guaranteeing sparsity — and what you get is a bench-ready formula sheet of "30 materials, each amount a positive number, summing to 100%."
Note that these mathematicians — Lawson, Hanson, Tibshirani — were not chemists. What they solved were abstract mathematical problems. But because the abstract form of that problem happens to match fragrance deconvolution exactly, today's algorithm runs on just 80 lines of Python.
This is the most beautiful thing about mathematics: invented in a completely unrelated field, and picked up 30 years later for use in another.
Figure 5 · 1974 Lawson-Hanson NNLS → 1996 Tibshirani LASSO → 2026 fragrance deconvolution: half a century of accumulated mathematics, picked back up
IX. The Dictionary Is the Moat, the Material Data Is the Wall
By now you should have noticed a counterintuitive fact:
The algorithm itself holds no secret. NNLS is in scipy, LASSO is in sklearn, the anchoring method is common sense. Any engineer who knows statistics could build a set in two weeks.
What's genuinely hard is the data.
To run this deconvolution system, you need:
| Data Asset | What It Is | Difficulty |
|---|---|---|
| Material dictionary | Chinese and English names, CAS, aroma descriptions, and volatility for over a thousand materials | Industry-internal material, unobtainable to outsiders |
| Essential-oil GC-MS library | The complete spectral fingerprint of every commonly used essential oil | One measurement runs 1,500–2,500 yuan; a full spectrum needs 40+ oils |
| Formula ground-truth reference set | Paired samples of known formula + known GC-MS | The most secret thing in the industry, almost never circulated |
| CAS one-molecule-many-names annotation | The several commercial names of the same molecule across different manufacturers | The dirty work no one is willing to do, but which must exist |
In our current system:
- An internally circulated material dictionary of 1,054 entries, 979 entered into the database after deduplication
- GC-MS fingerprints of 18 essential oils (from 17 raw datasets provided by an industry partner)
- The "problem + compounder's formula" pairing for Sample No. 8 (the blind-test gold standard)
- A 488-entry audit layer for CAS one-molecule-many-names (an industry first)
Through 6 rounds of independent third-party blind testing (dual-LLM cross-checking of 188 samples), the true error rate of the material database was driven down from 17% all the way to below 1.5%.
Figure 6 · Material database v1→v5.1 true error rate: 17% pressed all the way down to below 1.5%, verified by 6 rounds of independent LLM blind testing
On a typical oud-agarwood compound fragrance sample, the system's current capability is:
- Form coverage 87.6% — 87.6% of the ingredients in the ingredient sheet have a material classification; the remaining 12.4% are placeholder gaps
- Essential-oil identification recall 100% — every essential oil used in the formula was identified
- Essential-oil identification precision 100% — the dual-signal cross-check vetoed all false positives
- Overall usability roughly 70% — once the client has this first draft, the remaining work is no longer "starting from scratch" but correcting on a draft that is "70% usable, 30% still to be fine-tuned"
3 to 7 days → 1 day. This is the speed-up ratio the industry can currently deliver.
X. Why Not Proactively Expand the Library?
Reading this far, you might ask: since the algorithm is clear and the data is the wall, why not just spend the money to fill in the data and expand the library to 2,000 entries?
Because this road has a counterintuitive trap — the marginal return on proactively expanding the library is diminishing.
There are thousands of essential oils, but 80% of fragrances use only about 40 main oils. Beyond 50 oils, the gain in "real-world hit rate" from each additional one decays rapidly. The same goes for synthetic monomers — past a thousand commercial names, each additional 100 entries only shaves off another 1–3% of the placeholder gaps.
More importantly, the next iteration of this system is the full NNLS + LASSO deconvolution, an engineering effort of 6–7 days. This step doesn't need more data — it needs more "samples with known answers" — that is, a "problem + ground-truth" reference set.
And that kind of data can't be bought on the open market. It sits only in the hands of two kinds of people:
- Upstream material makers and independent essential-oil suppliers — you hold the complete GC-MS of your own products.
- OEM copy-sample factories and perfumery studios — you hold paired records of "sample formula + client's original-product GC-MS."
If you're reading this article and you happen to belong to either of these two groups — you're welcome to plug in. Cooperation is not limited to cash: data exchange, subscription licensing, per-order revenue share are all open to discussion. Contribute one essential-oil GC-MS or one set of formula ground truth, and in return you get priority access to an engineered deconvolution system that has already passed 6 rounds of blind testing.
This isn't marketing spin. It's because the next leap for this system was never an algorithm problem in the first place — it's a data-cooperation problem.
XI. The Current Boundary of Capability
Let me honestly write down what the system can't do right now:
| Still Can't Do | Reason | Waiting On |
|---|---|---|
| Precise splitting of multi-source compounds | NNLS+LASSO not yet integrated | 6–7 days once triggered |
| Amount accuracy of ±3% | Missing the "problem+ground-truth" reference set | N=10–30 samples |
| High-end natural-perfume-grade deconvolution | Essential-oil library covers 18/40+ | Add 22–25 GC-MS records |
| Cloning name-brand perfumes | Legal red line | Won't do |
Figure 7 · v1.10 current-capability six-dimension profile — finding things 100%, weighing numbers ±6.7pp, splitting sources 0% (to be unlocked in v2.0)
The last row matters — any request to deconvolve finished products from the likes of Chanel, Dior, or Tom Ford, we decline across the board. This isn't a technical problem; it's an intellectual-property one. The compliant uses of this system are clearly defined:
- ✅ Analyzing one's own products
- ✅ Client-paid compliant analysis (OEM copy-sampling, material procurement, quality inspection)
- ✅ Accelerating the workflow of independent perfumers
- ⚠️ Directly selling deconvolved formulas — won't do
- ⚠️ Deconvolving name-brand perfumes — won't do
XII. Summary
The essence of GC-MS deconvolution: it isn't AI smelling perfume, it's using 50-year-old statistics to solve a structured inverse problem.
The essence of the anchoring method: work backwards — infer material amounts from molecular proportions.
The essence of NNLS: a gift from 1974 — guaranteeing the answer is non-negative.
The essence of LASSO: a revolution from 1996 — guaranteeing the answer is sparse.
The essence of the dual-signal cross-check: not making the algorithm smarter, but teaching the algorithm to doubt itself.
The essence of the whole system: the algorithm is public, the dictionary is private, the data is scarce. The algorithm can be reproduced in two weeks, but a database validated by 6 rounds of independent blind testing, a 488-entry CAS one-molecule-many-names audit, and a "problem+ground-truth" reference set — for these there is no shortcut.
You don't need to train an AI. You don't need a GPU cluster. You don't need to hand the fragrance over to a large model to "understand."
What you need is: a material dictionary, a set of essential-oil fingerprints, a few ground-truth samples, and half a century of statistics.