Abstract: Assigning discriminable and harmonic colors to samples according to their class labels and spatial distribution can generate attractive visualizations and facilitate data exploration. However, as the number of classes increases, it is challenging to generate a high-quality color assignment result that accommodates all classes simultaneously. A practical solution is to organize classes into a hierarchy and then dynamically assign colors during exploration. However, existing color assignment methods fall short in generating high-quality color assignment results and dynamically aligning them with hierarchical structures. To address this issue, we develop a dynamic color assignment method for hierarchical data, which is formulated as a multi-objective optimization problem. This method simultaneously considers color discriminability, color harmony, and spatial distribution at each hierarchical level. By using the colors of parent classes to guide the color assignment of their child classes, our method further promotes both consistency and clarity across hierarchical levels. We demonstrate the effectiveness of our method in generating dynamic color assignment results with quantitative experiments and a user study.
The Challenge of High-Dimensional Coloring
Visualizing datasets with hundreds of categories is a "color nightmare" because humans can only distinguish a handful of colors at once. In data visualization, color is a primary tool for distinguishing classes, but we hit a "scalability wall" quickly: once you have more than a dozen classes, it becomes nearly impossible to find colors that are both easy to tell apart (discriminability) and pleasant to look at (harmony).
A common workaround is to use a hierarchy (e.g., "Animals" $\rightarrow$ "Mammals" $\rightarrow$ "Dogs"). However, existing methods for coloring these hierarchies often fail. Static methods try to color everything at once, leading to a muddy mess where sub-classes are indistinguishable. Conversely, independent methods color each level from scratch, destroying the user's "mental map" because a category that was blue at one level might suddenly turn orange at the next.
Methodology: Multi-Objective Optimization
The researchers formulated color assignment as a multi-objective optimization problem prioritizing three goals in order: Discriminability > Harmony > Spatial Distribution.
Key technical components include:
- Priority-Specific Pareto Optimization: Instead of a simple weighted sum, they use a "continuation method." The algorithm starts by optimizing solely for discriminability (using CIEDE2000 for perceptual difference). Once a baseline is established, it sequentially incorporates harmony and spatial distribution constraints.
- Spatial Awareness: The algorithm looks at the actual layout of the data (scatterplots, grids, or parallel coordinates). It pushes colors further apart if classes are physically adjacent on the screen to make boundaries clearer.
- Simulated Annealing: This is used to navigate the complex optimization landscape to find a high-quality color set in real-time, typically under one second for 30 classes.
Dynamic Hierarchical Exploration
To maintain the mental map during exploration, the system defines "spheres" in the CIELCh color space centered on the parent class's color. Child classes are assigned colors within these spheres, ensuring they "look like" they belong to their parent classes.
Because the system is dynamic, it can "recycle" color ranges. If a user zooms into a specific branch of the tree, the system can spread those sub-classes across a wider range of the color space that was previously occupied by invisible branches, maximizing clarity without losing the hierarchical context.
Key Results and Insights
The method was evaluated across 12 diverse datasets, including the massive ImageNet1k. Key findings include:
- The "Mental Map" is Hue-Dependent: Users primarily track parent-child relationships through hue. Therefore, the system allows more flexibility in saturation and lightness while keeping the hue relatively close to the parent's "anchor" color.
- Quantitative Performance: In hierarchical tests, the proposed method achieved a Perceptual Difference (PD) score of ~16.5, significantly higher than SOTA hierarchical methods like Tree Colors.
- User Preference: In a study with 20 experts, the method ranked #1 in discriminability and #1 in hierarchical alignment.
Limitations and Future Work
While the framework is flexible, the current implementation does not explicitly optimize for color vision deficiency (CVD). Additionally, the perception of color changes based on whether you are looking at a tiny dot in a scatterplot or a large block in a treemap; the current model doesn't fully account for this "size-color" interaction. Future work could also allow users to provide "like/dislike" feedback to steer the harmony templates toward specific brand colors or personal tastes.
Summary updated