PhotographAir Vent Detector

In a building, the vents decide much of where the air goes, so finding them is the first step toward picking a good spot to sample the air. This model finds indoor air vents (ceiling diffusers, return grilles, long slot vents and wall registers) in camera photos, and it is small and fast enough to run live on an iPad while someone scans a room. It is the vent finder inside PhotographAir, a research iPad app from the University of Wisconsin–Madison that documents rooms for indoor air sampling.

The model is RF-DETR Nano fine-tuned for one class (vent), saved as a Core ML package (PhotographAirVentDetector.mlpackage, float16, about 52 MB). On an iPad it takes about 30 ms per photo, and it is released under the Apache 2.0 license.

How to use it

Resize each photo to 384 by 384 (bilinear), scale it to the range 0 to 1, and normalize it with the mean (0.485, 0.456, 0.406) and standard deviation (0.229, 0.224, 0.225) in NCHW order. The model returns pred_boxes (center x, center y, width and height, as fractions of the photo) and pred_logits (one score per query, before a sigmoid). PhotographAir keeps boxes that score 0.5 or higher, and preprocessing.json holds every setting in one place.

Inside the app, a box only becomes a suggested vent once the model sees it in at least two photos during a scan, which clears out most of the one-off wrong boxes.

Training data

We trained it only on public photos with permissive licenses and on the lab's own photos. That includes Open Images photos with vents (CC BY 2.0 photos with CC BY 4.0 labels), COCO photos whose license is CC BY or no known copyright, and the scan photos the lab's own team took with PhotographAir during air sampling visits to buildings in three cities. The vent boxes were first suggested by OWLv2, then checked and corrected by people with help from Claude and ChatGPT.

How good is it

We compared it with four general-purpose detectors that look for objects from a text prompt, used as they come (not trained for vents): OWLv2 base, OWLv2 large, Grounding DINO and Florence-2. Every model was scored the same way on the same 765 test photos.

The test photos are the lab's own PhotographAir scan photos from Cancun, Guatemala City and Toronto (14 room scans in all). To keep the test fair for our model, we trained three extra copies of it, each with one city's photos left out, and tested each copy only on the city it had never seen. The general models never trained on any of these photos. The released model was then trained with all three cities included.

Those test photos show 21 different vents. Most vents were photographed more than once as the iPad moved around the room, so together they show up 60 times (in 53 photos, since a few photos have two vents in them). The chart counts both ways. On the left, every time a vent appears in a photo counts on its own (vent sightings, out of 60). On the right, each real vent counts once, and it counts as found when the model finds it in more than half of the photos it appears in (physical vents, out of 21).

Vents found against wrong boxes

Of the 14 scans, 8 have vents in them, mostly long ceiling slots. The chart stops at 20 wrong boxes per 100 photos. Florence-2 isn't on it, because it can't be dialed down: it draws about 107 wrong boxes for every 100 photos, more than one per photo. The app's setting (the diamond) was fixed beforehand on separate photos, while each general model gets whichever setting suits it best on these test photos.

Watch how this graph is made

Holding every model to the same number of wrong boxes gives the table below (vent sightings out of 60, then physical vents out of 21).

Wrong boxes per 100 photos This model OWLv2 base OWLv2 large Grounding DINO
1 30, 7 24, 6 11, 2 0, 0
2 39, 10 30, 7 26, 5 0, 0
5 44, 13 35, 10 33, 8 0, 0
10 48, 16 41, 12 40, 11 8, 1

A sighting counts as found when a box overlaps it by at least 0.3 (intersection over union), and a box that overlaps no vent by even 0.1 counts as wrong. Florence-2 gives no confidence score for its boxes, so there is nothing to dial up or down (it finds 43 sightings while drawing about 107 wrong boxes per 100 photos). The general models took about 1 to 2 seconds per photo on a desktop Mac.

On these photos, when wrong boxes have to stay few, this model finds more vents than any of the general models we tried, and it does so far faster on a much smaller chip. However, the test is small, so the lead over OWLv2 held in about 80 to 95 of 100 random redraws of the test rather than in all of them. Most of the test vents are also long ceiling slots (floor registers, round diffusers and exhaust fans aren't in it at all), and the general models were used as they come rather than tuned for vents. Finally, the released model was trained with all three test cities included, so it isn't the exact file these numbers measured.

Limitations

It can miss vents seen at a steep angle, far away or partly hidden, along with some wood or decorative wall grilles. It can also box things that look like vents, such as slatted panels, speaker grilles and light fixtures, and it expects photos to be upright, the way an iPad camera takes them.

Credits

The model builds on RF-DETR by Roboflow (Apache 2.0). Training photos come from Open Images (Google) and COCO (Microsoft and contributors), each under its own license. It was built for PhotographAir in the Department of Pathology and Laboratory Medicine at the University of Wisconsin–Madison.

Development supported by Inkfish LLC. PhotographAir Vent Detector is developed in association with the Lungfish Research Collaboratory.

Downloads last month
-
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for elioconnor/photographair-vent-detector

Quantized
(5)
this model