Just like a fruit fly, a new algorithm never forgets old scents

Just like a fruit fly, a new algorithm never forgets old scents

就像果蝇一样,一种新算法永远不会忘记旧气味

Fruit flies aren’t exactly famous for their brainpower; you’ve probably drowned more than one in a wine glass left too long on the patio table. And yet, working with roughly 140,000 neurons—a brain smaller than a poppy seed—Drosophila can sort through a huge range of smells in a fraction of a second, and then retain the memory of that scent for a long time. 果蝇并不以其智力而闻名;你可能在露台桌上放得太久的酒杯里淹死过不止一只。然而,果蝇仅靠大约 14 万个神经元(大脑比罂粟种子还小)就能在几分之一秒内分辨出多种气味,并能长时间保留对这些气味的记忆。

In this, they do much better than current “electronic noses.” Even the most advanced ones on the market tend to be expensive, painfully narrow in what they can detect, and quick to forget an odor the moment they learn a new one. So why not just copy the fly? That’s the question a growing number of researchers have been asking—including Kevin Max and Yang Shen at the Okinawa Institute of Science and Technology, whose new algorithm, Spi-Fly, is described in a paper recently published in the journal Neuromorphic Computing and Engineering. 在这方面,它们比目前的“电子鼻”表现得好得多。即使是市场上最先进的电子鼻,往往也价格昂贵,检测范围极其有限,而且一旦学习了新气味,就会迅速忘记旧气味。那么,为什么不直接模仿果蝇呢?越来越多的研究人员正在探讨这个问题,其中包括冲绳科学技术大学院大学(OIST)的 Kevin Max 和 Yang Shen。他们的新算法“Spi-Fly”在最近发表于《神经形态计算与工程》(Neuromorphic Computing and Engineering)期刊的一篇论文中得到了详细描述。

A rather obscure sense

一种相当晦涩的感官

Smell is a strange sense, mechanically speaking. Vision and hearing both reduce to a single physical dimension you can plot on a graph—wavelength—which makes them relatively tidy to study. Odor molecules, by contrast, can’t be reduced to any single physical dimension. Biology had to find a messier solution instead: hundreds of different receptor proteins, each shaped to grab onto specific molecular features, firing in combinations that the brain then has to decode. It’s a system so combinatorially complex that it took until 1991 for Linda Buck and Richard Axel to even identify the receptor gene family behind it, work that won them a Nobel Prize in 2004. 从机制上讲,嗅觉是一种奇怪的感官。视觉和听觉都可以简化为可以在图表上绘制的单一物理维度——波长,这使得它们的研究相对简单。相比之下,气味分子无法简化为任何单一的物理维度。生物学不得不寻找一种更复杂的解决方案:数百种不同的受体蛋白,每种蛋白的形状都能捕捉特定的分子特征,通过组合触发信号,然后由大脑进行解码。这个系统的组合复杂性极高,直到 1991 年,琳达·巴克(Linda Buck)和理查德·阿克塞尔(Richard Axel)才确定了其背后的受体基因家族,这项工作使他们在 2004 年获得了诺贝尔奖。

Despite the difficulties in our understanding of smell, “electronic noses” exist on the market. Companies like Alpha MOS, Aryballe, and Odotech sell them for food-quality control, environmental monitoring, and security screening. What these noses are bad at is generalizing. A device with software that is tuned to sniff out spoiled olive oil isn’t the same as a device that flags a specific explosive at an airport checkpoint. Retooling one for a new task usually means retraining its software almost from scratch. 尽管我们对嗅觉的理解存在困难,但市场上确实存在“电子鼻”。Alpha MOS、Aryballe 和 Odotech 等公司销售这些设备,用于食品质量控制、环境监测和安全检查。这些电子鼻的弱点在于泛化能力差。一台经过调试以嗅出变质橄榄油的设备,与一台在机场安检处标记特定爆炸物的设备并不相同。为新任务重新配置设备通常意味着几乎要从零开始重新训练其软件。

Two technical bottlenecks sit behind that limitation. First, these systems typically need a mountain of hand-labeled examples before they can reliably tell one smell from another. Second, teaching them a new odor tends to scramble what they already knew, a problem researchers call “catastrophic forgetting”—the electronic equivalent of forgetting how to ride a bike right after learning to swim. 这一局限性背后存在两个技术瓶颈。首先,这些系统通常需要海量的人工标注样本,才能可靠地分辨出不同的气味。其次,教它们识别新气味往往会扰乱它们已有的知识,研究人员称之为“灾难性遗忘”——这相当于在学会游泳后立刻忘记了如何骑自行车。

Odor barcodes

气味条形码

Fruit flies—and plenty of other insects—don’t have this problem, despite their minuscule brains. How do they tell odors apart and remember them with so little brainpower to work with? The secret, according to the paper’s authors, is something called sparse coding. Think of it as the fly’s brain assigning a barcode to every smell. Its olfactory system relies on roughly 2,000 specialized cells, called Kenyon cells, that receive sparse, randomly wired signals passed on from the fly’s odor receptors. 果蝇以及许多其他昆虫虽然大脑微小,却不存在这个问题。它们是如何在脑力资源如此有限的情况下分辨并记住气味的呢?论文作者认为,秘诀在于一种叫做“稀疏编码”(sparse coding)的技术。你可以把它想象成果蝇的大脑为每种气味分配了一个条形码。它的嗅觉系统依赖于大约 2,000 个被称为“肯扬细胞”(Kenyon cells)的特殊细胞,这些细胞接收来自果蝇气味受体的稀疏且随机连接的信号。

Those Kenyon cells all report to a single relay point: the anterior paired lateral neuron, or APL (actually a symmetrical pair of them, one per brain hemisphere). The APLs respond by firing strong, global inhibition back at every Kenyon cell at once, silencing nearly all of them. The cells that remain active after that crackdown are what Max and Shen call the barcode for that particular odor. 这些肯扬细胞都向一个单一的中继点报告:前侧配对神经元(APL,实际上是一对对称的神经元,每个大脑半球各一个)。APL 通过同时向所有肯扬细胞发出强烈的全局抑制信号来做出反应,使几乎所有的肯扬细胞静默。在这次抑制后仍然保持活跃的细胞,就是 Max 和 Shen 所称的该特定气味的“条形码”。

Spi-Fly picks up the story only after a sensor has already done its job—everything here happens in simulation, using pre-recorded sensor data, and the algorithm itself has nothing to do with capturing the smell in the first place. In Max and Shen’s work, sensor readings become a stream of spikes, projected sparsely and randomly onto a hidden layer that stands in for the Kenyon cells, with neurons inhibiting each other instead of relying on a single APL-like referee. From there, the hidden layer connects to an output layer, one neuron per labeled odor, waiting to learn which barcode belongs to which smell. Spi-Fly 的工作始于传感器完成任务之后——这里的一切都在模拟中进行,使用预先记录的传感器数据,算法本身与最初的气味捕捉过程无关。在 Max 和 Shen 的研究中,传感器读数变成了一串脉冲,稀疏且随机地投射到一个代表肯扬细胞的隐藏层上,神经元之间相互抑制,而不是依赖单一的 APL 式裁判。在此基础上,隐藏层连接到一个输出层,每种标记的气味对应一个神经元,等待学习哪个条形码属于哪种气味。

A simple rule

一个简单的规则

What actually gets learned is the connection between a barcode and its label, following a simple, decades-old neural network rule: Every time a hidden neuron fires alongside the correct answer, that link gets a little stronger. Nothing more. There’s no need for backpropagation, the technique co-invented by 2024 physics Nobel laureate Geoffrey Hinton that trains most modern neural networks by working backward through every layer to calculate exactly who’s to blame for a mistake. 实际学习的是条形码与标签之间的联系,遵循的是一个简单的、几十年前的神经网络规则:每当一个隐藏神经元与正确答案同时触发时,该链接就会增强一点。仅此而已。不需要反向传播(backpropagation)——这项由 2024 年诺贝尔物理学奖得主杰弗里·辛顿(Geoffrey Hinton)共同发明的技术,通过逐层反向计算来确定错误责任,从而训练大多数现代神经网络。

In their tests, the simplified system works. On a set of odors picked up by common gas sensors, Spi-Fly peaks after just three exposures to each one, while backpropagation needs roughly 70 to get there. Feed the network new odors a couple at a time—a stress test for catastrophic forgetting—and Spi-Fly barely blinks, holding onto old smells with almost no accuracy loss, while backpropagation crashes down into near random-guessing territory. 在测试中,这个简化系统表现良好。在普通气体传感器采集的一组气味测试中,Spi-Fly 在每种气味仅接触三次后就达到了峰值,而反向传播则需要大约 70 次。一次向网络输入几种新气味——这是对“灾难性遗忘”的压力测试——Spi-Fly 几乎不受影响,在几乎没有精度损失的情况下记住了旧气味,而反向传播则崩溃到接近随机猜测的水平。

There’s another practical hurdle: memory. The whole point of designing a network this simple is to eventually run it on neuromorphic chips—a fast-developing technology that builds hardware that mimics the brain directly by processing spikes instead of running conventional software. Those chips typically don’t have much memory to work with. Any algorithm running on one has to make do with a fraction of what a regular computer takes for granted. Spi-Fly degrades far less than backpropagation does under those constraints. 另一个实际障碍是内存。设计如此简单的网络的全部意义在于最终将其运行在神经形态芯片上——这是一种快速发展的技术,通过处理脉冲而不是运行传统软件来构建直接模拟大脑的硬件。这些芯片通常没有太多的内存可用。任何在其上运行的算法都必须在常规计算机所认为的极小资源下完成工作。在这些限制条件下,Spi-Fly 的性能下降远小于反向传播。

There’s a ceiling, though, as Max himself admits. “If the sparse code layer contains 100 neurons, and each odor is represented by 5 neurons, the theoretical upper limit of odor capacity is ‘100, choose 5,’” he explained in an email—roughly 75 million possible “barcodes.” But real-world noise erases nearly all of that headroom. 不过,正如 Max 本人所承认的,这也有一个上限。“如果稀疏编码层包含 100 个神经元,每种气味由 5 个神经元表示,那么气味容量的理论上限就是‘100 选 5’,”他在一封电子邮件中解释道——大约有 7,500 万种可能的“条形码”。但现实世界中的噪声几乎抹去了所有这些余量。