← Latest papers
💻 computer science

PPSNet: Perceptual Prior Similarity-guided Network for Class-agnostic Counting

This paper introduces PPSNet, a novel class-agnostic counting framework that theoretically validates the Extract-and-Match paradigm and addresses the limitations of bounding box-based visual exemplars by employing a Perceptual Prior Construction Module to refine scale distribution and a Similarity-guided Weighting Module to enhance feature matching, thereby achieving superior performance across visual, text, and zero-shot prompting scenarios.

Original authors: Shengwei Jia, Junhui Liu, Jiahao Wang, Yongqiang Cui, Shihui Zhang

Published 2026-08-12
📖 4 min read☕ Coffee break read

Original authors: Shengwei Jia, Junhui Liu, Jiahao Wang, Yongqiang Cui, Shihui Zhang

Original paper licensed under CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

Imagine you are a detective trying to solve a mystery in a crowded room. Your job is to count how many people are wearing red hats. In the old days, if you wanted to count blue hats, you'd have to hire a whole new team of detectives who only knew how to spot blue. But what if you could teach one detective to count any hat, just by showing them a single example? This is the world of "class-agnostic counting," a branch of computer vision where machines learn to count objects of any kind—birds, cars, or cookies—without needing a specific training manual for each new type.

To do this, the detective usually needs a "prompt," a little hint to tell them what to look for. Sometimes this hint is a sentence like "count the seagulls," or sometimes it's just the machine guessing on its own. But the most accurate method so far has been "vision-guided" counting: showing the computer a few tiny pictures (exemplars) of the object you want to count, usually drawn inside a square box. Think of it like handing the detective a photo of a seagull and saying, "Find everyone who looks like this." The problem is, the square box is a bit clumsy. It often grabs a chunk of the ocean or the sky along with the bird. As the computer gets deeper into its thinking, it starts getting confused by that extra background noise, thinking the water is part of the bird, which leads to a bad count.

This paper introduces a new detective team called PPSNet (Perceptual Prior Similarity-guided Network) that fixes these clumsy mistakes. The researchers argue that the old way of working—where the computer first studies the photo and the example separately, and then tries to match them—is like trying to solve a puzzle by looking at the pieces in one hand and the picture in the other, without ever letting your hands touch. They propose a new way where the computer looks at the photo and the example together from the very start, allowing them to talk to each other and refine their understanding instantly.

But PPSNet doesn't just change how they look; it changes what they see. The team noticed that the square boxes used to grab the examples were too messy. So, they built a special tool called the Perceptual Prior Construction Module. Imagine if, instead of just handing the detective a blurry, stretched-out photo of a bird, you also gave them a mental map—a glowing "heat map"—that shows exactly where the bird is inside that messy box and where the ocean starts. This map tells the computer, "Ignore the water; focus on the bird." This stops the computer from getting distracted by the background noise that usually tricks it.

Furthermore, the team added a Similarity-guided Weighting Module. This acts like a spotlight. Once the computer finds a spot in the big photo that looks like the example, this module turns up the brightness on that spot and dims everything else. It's like the detective saying, "Aha! This looks exactly like the bird I was shown!" and ignoring the rest of the room. They also proved that this "spotlight" works best when they train the computer to pay attention to the difference between the bird and the background, using a technique similar to how humans learn to tell things apart by comparing them.

The results are impressive. When tested on massive datasets containing thousands of images of everything from parking lots to crowds of people, PPSNet made fewer mistakes than any previous method. For example, on a test set of 6,135 images, the new method reduced the average counting error significantly compared to the previous best. It even worked when the researchers removed the visual examples entirely, letting the computer count based on just a text description or no hint at all, though it still performed best when it could see a few examples.

The authors are careful to note that while their method is a major step forward, it's not magic; it still relies on the computer seeing the image and the example. They also point out that the old method of using square boxes to grab examples is inherently flawed because it forces irregular shapes into a rigid frame, losing important details. PPSNet doesn't just patch this hole; it builds a new foundation that understands the shape and distribution of the object better than the box ever could. By combining a "mental map" of the object's location with a "spotlight" that highlights matches, this new network helps computers count the world with a level of precision that was previously out of reach.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →