Confidence-Consistency Evaluation for Time Series Anomaly Detection
Project description
CCE & RankEval: Confidence-Consistency Evaluation for Time Series Anomaly Detection
A comprehensive evaluation framework for time series anomaly detection metrics, focusing on confidence-consistency evaluation, robustness assessment, and discriminative power analysis. This implementation provides novel evaluation metrics and benchmarking tools to improve the reliability and comparability of anomaly detection models.
๐ Paper: arXiv:2509.01098
๐ Website: CCE & RankEval
๐ Features
- Multi-metric Evaluation: Support for various anomaly detection metrics (F1, AUC-ROC, VUS-PR, etc.)
- Performance Benchmarking: Latency analysis and theoretical ranking validation
- Robustness Assessment: Noise-resistant evaluation with variance consideration
- Discriminative Power Analysis: Both ranking-based and value-change-ratio-based approaches
- Automated Testing: Streamlined evaluation pipeline for new metrics
- Real-world Dataset Support: Comprehensive testing on multiple datasets
๐ฆ Installation
Option 1: Install from PyPI (Recommended)
pip install cce
Option 2: Install from Source
# Clone the repository
git clone https://github.com/EmorZz1G/CCE.git
cd CCE
# Install dependencies
pip install -r requirements.txt
# Install in development mode
pip install -e .
Note: Build-related files are located in the docs directory. For detailed build instructions, please refer to docs/*.md.
๐ง Requirements
- Python 3.8+
- PyTorch
- NumPy
- Other dependencies (see
requirements.txt)
โ๏ธ Configuration
After installation, you may need to configure the datasets path:
# Create a configuration file
cce config create
# Set your datasets directory
cce config set-datasets-path /path/to/your/datasets
# View current configuration
cce config show
For detailed configuration options, see Configuration Guide.
๐ Quick Start
Confidence-Consistency Evaluation (CCE)
from cce import metrics
metricor = metrics.basic_metricor()
CCE_score = metricor.metric_CCE(labels, scores)
RankEval
Basic Usage
# Run baseline evaluation
. scripts/run_baseline.sh
# Run real-world dataset evaluation
. scripts/run_real_world.sh
Adding New Metrics
-
Implement the metric function in
src/metrics/basic_metrics.py:def metric_NewMetric(labels, scores, **kwargs): # Your metric implementation return metric_value
-
Add evaluation logic in
src/evaluation/eval_metrics/eval_latency_baselines.py:elif baseline == 'NewMetric': with timer(case_name, model_name, case_seed_new, score_seed_new, model, metric_name='NewMetric') as data_item: result = metricor.metric_NewMetric(labels, scores) data_item['val'] = result
-
Run the evaluation:
python src/evaluation/eval_metrics/eval_latency_baselines.py --baseline NewMetric
-
View results in
logs/NewMetric/
๐๏ธ Project Structure
CCE/
โโโ src/ # Source code
โ โโโ metrics/ # Metric implementations
โ โโโ evaluation/ # Evaluation framework
โ โโโ models/ # Model implementations
โ โโโ data_utils/ # Data processing utilities
โ โโโ utils/ # Helper functions
โ โโโ scripts/ # Execution scripts
โโโ # Build and installation files
โ โโโ setup.py # Package setup configuration
โ โโโ pyproject.toml # Modern Python package config
โ โโโ MANIFEST.in # Package file inclusion
โ โโโ BUILD.md # Detailed build instructions
โ โโโ INSTALL.md # Quick install guide
โโโ datasets/ # Dataset storage
โโโ logs/ # Evaluation results
โโโ tests/ # Test files
โโโ docs/ # Documentation
โโโ requirements.txt # Dependencies
โโโ setup.py # Simple setup entry point
โโโ pyproject.toml # Basic build configuration
๐ Supported Evaluations
- Latency Analysis: Metric computation time measurement
- Theoretical Ranking: Validation against theoretical expectations
- Robustness Assessment: Noise resistance evaluation
- Discriminative Power: Ranking-based and value-change-ratio analysis
๐ Updates
- 2025-08-26: Core evaluation framework implementation
- 2025-08-26: Multi-metric support and benchmarking
๐ TODO List
- Automated standard evaluation pipeline
- Enhanced robustness assessment
- Advanced discriminative power analysis
- CI/CD integration for metric testing
๐ค Contributing
We welcome contributions! Please feel free to submit issues and pull requests.
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
๐ Acknowledgments
- FTSAD: For providing the time series anomaly detection evaluation framework
- SimAD: For dataset load.
- TSB-AD: For model implementation code
- Community: For feedback and contributions
๐ Contact
For questions and support, please open an issue on GitHub or contact the maintainers.
๐ Citation
If you find our work useful, please cite our paper and consider giving us a star โญ.
@article{zhong2025cce,
title={CCE: Confidence-Consistency Evaluation for Time Series Anomaly Detection},
author={Zhong, Zhijie and Yu, Zhiwen and Cheung, Yiu-ming and Yang, Kaixiang},
journal={arXiv preprint arXiv:2509.01098},
year={2025}
}
CCE - Making time series anomaly detection evaluation more reliable and comprehensive.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cce-0.3.2.tar.gz.
File metadata
- Download URL: cce-0.3.2.tar.gz
- Upload date:
- Size: 234.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c3e605d52c159d00451ab243776862ea90f621e7096203c40bfea037bf4a30e1
|
|
| MD5 |
7a59894debe056af5b5a1f54954ae285
|
|
| BLAKE2b-256 |
b56ee865c9569a3aa4f27dc6c44f5cc6d55a4b4afbfb2b0524348f81f4c3dfe1
|
File details
Details for the file cce-0.3.2-py3-none-any.whl.
File metadata
- Download URL: cce-0.3.2-py3-none-any.whl
- Upload date:
- Size: 281.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9465a373a2b4beb8b7c52469bf22e775750c52d5219ee2a2f633fec11634bce3
|
|
| MD5 |
2dc7d7a7495187d7c5e9bfd7d7629ed9
|
|
| BLAKE2b-256 |
5b732fb1a9ec1762db3d44fcc451e411dbed507c84c8939835ec217b3605e084
|