Finding cats
A frame taken from the camera or video is fitted into a square while keeping its aspect ratio. Empty space is filled with padding. The D-FINE object detection model marks regions that may contain a cat with rectangular boxes, and the app crops those regions from the original image.
In video, a detection score for the same cat can briefly fall, for example when it moves partly behind an object. The app therefore accepts a weak candidate only when the current frame contains a candidate box that overlaps enough with a recent high-score box. If no box qualifies in the current frame, the on-screen box is removed. [1] [2]
Technical details: detection model and box association
D-FINE represents each of the four box boundaries as a probability distribution, then refines their positions in stages. This site uses the Nano model pretrained on COCO and evaluates cat candidates at 640 × 640 pixels.
The normal acceptance threshold is 0.34. In video, a candidate can be accepted down to 0.26 when its intersection over union (IoU) with a box scored at least 0.42 within the previous 8 seconds of the same playback session is at least 0.30. IoU is the overlapping area divided by the combined area of the two boxes. A weak box does not extend the 8-second window. The use of low-score candidates informed by prior positions was inspired by ByteTrack; here, the app compares the current box with a recent one.
A new low-score box in video is shown only after it has been confirmed at least three times in a similar position over 3 seconds or more. A late result is discarded if the image inside its box has changed substantially. Cat detection continues while mood estimation runs.
Comparing descriptions
The app prepares mood descriptions such as “a cat resting with a relaxed body.” SigLIP 2 was trained to match images with text, so it can compare a crop of the cat with each description. Text features are precomputed; only the image is processed on the device. [3]
Technical details: embeddings and zero-shot classification
Images and text are converted into lists of numbers that represent their features, called embedding vectors. The cat crop is resized to 224 × 224 pixels and encoded by the 4-bit quantized SigLIP 2 Base image encoder. The app multiplies cosine similarity with each class description vector by 38, then uses softmax to make the four candidate scores sum to 1.
Using descriptions to classify with a pretrained model, without further task-specific training, is called zero-shot classification. NekoScope does not perform additional model training.
Choosing what to show
A confirmed result can be shown when the highest-scoring one of the four candidates reaches 0.40. If Fearful or Aggressive ranks first, the app shows Tense, using that top candidate's score. If no candidate meets the display condition, or the image is too dark, the app shows Hard to tell.
- Relaxed
- 0.62
- Alert
- 0.20
- Fearful
- 0.11
- Aggressive
- 0.07
Show Relaxed. Its top score, 0.62, is above the 0.40 display threshold.
The percentages show how closely this image matched each description according to the model. To interpret model scores as actual probabilities of being correct, they would need to be calibrated on relevant data. [4]
Technical details: handling moment-to-moment changes in video
For each cat, the app updates an exponential moving average of its scores. A new score receives more weight when more time has passed since the previous analysis. Short delays before switching moods make the display less sensitive to a brief pose or camera shake. Relaxed and Alert also have a path that can show a result as tentative before it is confirmed.
What research on cat expressions tells us
Studies of cat expressions use observable movements, such as those of the eyelids and mouth, as clues. Bennett and colleagues filmed 29 cats in a shelter and analyzed short clips using CatFACS, a system for recording facial movements. In that setting, blinking and half-blinking were observed alongside behaviors associated with fear, while threat vocalizations and jaw movements were observed alongside behaviors associated with frustration. [5]
The same-looking behavior can mean different things depending on what happened before and after it, and on the surrounding situation. This site's result is only an observational estimate based on how a photo or video looks. Consider the cat's surroundings and changes from its usual behavior when judging its wellbeing or safety.
What we have tested
Exploratory still-image evaluation
Among 150 images selected because their descriptions contained clear behavioral clues, a mood was shown for 93 at threshold 0.40; 88 of those matched the reference labels. For 116 images with ambiguous clues, a mood was shown for 12. The reference labels came from the dataset, which covered photos labeled Relaxed or Aggressive.
Video tests on Pixel 6a
In an initial trial, six short clips were played in Chrome using WebGPU. Cat boxes were absent in 29 of 64 analyses, and a confirmed mood appeared in four. Mood estimates were limited in clips with changing light or viewing angles. In three additional clips recreating a cat's departure, no new cat box appeared in 95 analyses after the cat had left.
The still-image evaluation measures agreement with labels on selected images. The video tests measure how often results appeared with specific devices and clips. What can be observed depends on the conditions.
Video is processed on your device
The analysis models are first downloaded from this site. The pixels from your camera or selected files are then processed in the browser. Images do not need to be uploaded for analysis. In video, cat detection prioritizes WebGPU, while mood estimation runs in parallel using WebAssembly. On devices without WebGPU, detection also switches to WebAssembly.
If the models have been downloaded and remain in the browser cache, you can observe offline. Guide and asset credits
References
- Peng et al., ICLR 2025D-FINE: Redefine Regression Task in DETRs as Fine-grained Distribution Refinement
A model that finds objects in images and marks their locations with boxes.
- Zhang et al., ECCV 2022ByteTrack: Multi-Object Tracking by Associating Every Detection Box
A video tracking method that uses previous object positions to recover candidates whose scores have dropped.
- Tschannen et al., 2025SigLIP 2: Multilingual Vision-Language Encoders with Improved Semantic Understanding, Localization, and Dense Features
A vision-language encoder for comparing images and text in the same feature space.
- Guo et al., ICML 2017On Calibration of Modern Neural Networks
A study of the gap between model confidence scores and actual accuracy.
- Bennett, Gourkow, and Mills, Behavioural Processes, 2017Facial correlates of emotional behaviour in the domestic cat (Felis catus)
A study of the relationship between cat facial movements and observed behavior.