Abstract
We introduce a new class of image features, the Ray feature set, that consider image characteristics at distant contour points, capturing information which is difficult to represent with standard feature sets. This property allows Ray features to efficiently and robustly recognize deformable or irregular shapes, such as cells in microscopic imagery. Experiments show Ray features clearly outperform other powerful features including Haar-like features and Histograms of Oriented Gradients when applied to detecting irregularly shaped neuron nuclei and mitochondria. Ray features can also provide important complementary information to Haar features for other tasks such as face detection, reducing the number of weak learners and computational cost. Ray features can be efficiently precomputed to reduce cost, just as precomputing integral images reduces the overall cost of Haar features. While Rays are slightly more expensive to precompute, their computational cost is less than that of Haar features for scanning an AdaBoost-based detector window across an image at run-time.
The Challenge of Irregular Shapes
Most classical object detection frameworks, such as the Viola-Jones face detector, rely on features that evaluate fixed spatial arrangements. For example, a Haar-like feature might compare the average intensity of two adjacent rectangular regions. This approach is highly effective for rigid objects like faces or vehicles where the internal structure is relatively consistent.
However, biological structures like neuron nuclei or mitochondria are "squishy" and highly deformable. They stretch, rotate, and change scale drastically. In these scenarios, fixed-offset features like Haar or local gradient histograms (HOG) often fail because the object's boundary is rarely where the feature expects it to be. To compensate, traditional classifiers require a massive number of weak learners, leading to increased computational cost and higher error rates.
The Ray Feature Set
To address these limitations, we introduce Ray features, which are defined relative to the object's boundaries rather than fixed pixel coordinates. A Ray feature "casts a ray" from a starting point in a specific direction $\theta$ until it intersects the nearest edge. By locking the feature to the nearest contour, the descriptor becomes inherently robust to stretching and deformation.
The paper defines four primary types of Ray features:
- Distance Difference ($f^{diff}$): Compares the relative distances to edges in two different directions, providing scale-invariance.
- Distance ($f^{dist}$): The absolute distance to the nearest edge.
- Orientation ($f^{ori}$): The direction of the gradient at the edge point, useful for distinguishing convex versus concave shapes.
- Norm ($f^{norm}$): The strength of the edge at the intersection point.
To ensure real-time performance, we precompute "Ray maps" for a discrete set of angles. This allows feature evaluation during run-time to be a simple constant-time memory lookup, similar to the use of integral images for Haar features.
Experimental Results
We evaluated Ray features against Haar and HOG features across several challenging datasets, including 2-photon microscopy of migrating neurons and high-resolution FIBSEM imagery of mitochondria.
In biological detection tasks, Ray features significantly outperformed both Haar and HOG. For instance, in nucleus detection, the Ray-based classifier achieved a much lower false-positive rate for a given detection goal. Furthermore, the Ray models were remarkably compact; while a Haar-based classifier required nearly 1,000 weak learners to reach a specific performance threshold, the Ray-based version required fewer than 100.
Ray features also proved valuable for rigid object detection. In face detection experiments using the MIT-CMU dataset, Ray features were particularly effective at capturing the overall head shape (hairlines and chins), while Haar features remained superior for internal features like eyes. Combining them into a "Haar+Rays" hybrid classifier resulted in higher accuracy with fewer total learners.
Efficiency and Conclusion
While precomputing Ray maps is more computationally intensive than building an integral image (~85ms vs ~1ms for a standard frame), the scanning process is significantly faster. A Ray feature requires only one or two memory accesses, compared to the six or more required by Haar features. In a real-world test on a 640x480 image, the total detection time for Rays was 2.4 seconds, compared to 7.3 seconds for Haar features.
Ray features represent a powerful alternative for detecting non-rigid, deformable objects. By focusing on contour-relative sampling, they provide a robust and efficient solution for complex computer vision tasks in microscopy and beyond.
Summary updated