Skip to main content

result-analyzer

Compare reproduced results against paper-reported values. Generate Markdown/JSON/Beamer reports.

Jump to install

Source facts

Repository
orange4664/research-skills
Last source activity
March 31, 2026 at 06:46
Detected SKILL.md language
English
Stars
41
Forks
1

Install options

The review-first prompt is selected by default. You can switch to a direct command or download a local copy.

Review the source files

Read SKILL.md and any companion files shown by SkillsMP before deciding whether to install.

File Explorer
19 files

Showing SKILL.md

SKILL.md
Source instructions ยท Read-only preview
name
result-analyzer
description
Compare reproduced results against paper-reported values. Generate Markdown/JSON/Beamer reports.
# Result-Analyzer Skill ## Purpose The **final piece** of the reproduction pipeline. After running experiments, this skill compares your results against the paper's reported metrics, figures, and training curves โ€” then generates a structured report. ## When to Use - After `code-reproducer` has finished training on the remote GPU - User says "compare my results" or "how close are we to the paper?" - When writing a reproduction report or paper - To decide if reproduction was successful ## Architecture ``` Inputs Comparators Outputs โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ paper-parser JSON โ”€โ”€โ” โ”œโ”€โ”€โ†’ table_extractor โ”€โ”€โ”€โ” paper metrics โ”€โ”€โ”˜ โ”‚ โ”œโ”€โ”€โ†’ metric_comparator โ”€โ”€โ†’ Markdown Report repro metrics โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”€โ”€โ†’ JSON Report โ”€โ”€โ†’ Beamer Data repro train.csv โ”€โ”€โ”€โ”€โ†’ curve_comparator โ”€โ”€โ†’ comparison plots โ”€โ”€โ†’ latex-paper-skills โ”€โ”€โ†’ beamer-skill PPT repro images โ”€โ”€โ”€โ”€โ†’ image_comparator โ”€โ”€โ†’ SSIM/PSNR/FID paper figures โ”€โ”€โ”€โ”€โ”˜ โ”€โ”€โ†’ side-by-side figures ``` ## Quick Start ### Simple Metric Comparison ```bash python result-analyzer/analyze.py \ --paper-metrics '{"accuracy": 95.3, "FID": 3.17}' \ --repro-metrics '{"accuracy": 94.8, "FID": 3.45}' \ --title "DDPM Reproduction" \ -o report/ ``` ### Full Pipeline (paper JSON + training log + images) ```bash python result-analyzer/analyze.py \ --paper-json workspace/<paper>/paper_content.json \ --repro-log workspace/<paper>/train_log.csv \ --repro-images workspace/<paper>/generated/ \ --paper-figures workspace/<paper>/figures/ \ --fid \ --beamer \ -o workspace/<paper>/report/ ``` ### From Paper-Parser JSON Only ```bash python result-analyzer/analyze.py \ --paper-json paper_content.json \ --repro-metrics '{"accuracy": 94.8}' \ --method-name "Ours" \ -o report/ ``` ## Comparators ### 1. Metric Comparator (Core) Compares reproduced values against paper values with tolerance-based judgment. **Built-in Knowledge Base**: 50+ metrics with direction info: - `higher_better`: accuracy, BLEU, PSNR, SSIM, IS, mAP, AUC, F1... - `lower_better`: FID, loss, perplexity, WER, MAE, RMSE, LPIPS... **Judgment Logic**: | Status | Condition | |--------|-----------| | โœ… PASS | Within tolerance (default: ยฑ1 abs, ยฑ5% rel) | | ๐ŸŸข PASS | Better than paper! | | โš ๏ธ WARN | Within 2ร— tolerance | | โŒ FAIL | Outside tolerance | ### 2. Curve Comparator - Loads CSV/JSON training logs - Compares final values against paper - Pearson correlation between curves - Convergence speed analysis - Generates matplotlib comparison plots ### 3. Image Comparator - **SSIM** (Structural Similarity) โ€” via scikit-image - **PSNR** (Peak Signal-to-Noise Ratio) - **FID** (Frรฉchet Inception Distance) โ€” **optional**, requires `pytorch-fid` - Side-by-side comparison figures ### 4. Table Extractor - Reads paper-parser JSON output โ†’ finds result tables - Auto-detects "Ours" / "Proposed" / last row - Handles `ยฑ`, bold markers, `%` signs - Free-text metric extraction (e.g., "We achieve 95.3% accuracy") ## Output Formats ### Markdown Report (`reproduction_report.md`) ```markdown # Reproduction Report ## ๐ŸŸข Overall: PASS | Status | Metric | Paper | Reproduced | Diff | Note | |--------|--------|-------|-----------|------|------| | โœ… PASS | Accuracy | 95.3 | 94.8 | -0.5 โ†“ | Within tolerance | | โš ๏ธ WARN | FID | 3.17 | 3.45 | +0.28 โ†‘ | Close but slightly off | ``` ### JSON Report (`reproduction_report.json`) Structured data for downstream consumption: - `latex-paper-skills` โ†’ `results-backfill` skill - `beamer-skill` โ†’ reproduction PPT ### Beamer Data (`beamer_report_data.json`) Slide-by-slide data for generating a Beamer PPT: 1. Title slide (paper name + overall status) 2. Metric comparison table 3. Training curves figure 4. Sample comparison figure 5. Conclusion slide ## Integration with Other Skills ### โ†’ beamer-skill (Generate PPT) ```bash # 1. Run result-analyzer with --beamer flag python result-analyzer/analyze.py ... --beamer -o report/ # 2. Auto-generate Beamer .tex from JSON python beamer-skill/generate_beamer_report.py report/beamer_report_data.json -o report/reproduction_slides.tex # 3. Compile to PDF python beamer-skill/generate_beamer_report.py report/beamer_report_data.json -o slides.tex --compile ``` ### โ†’ latex-paper-skills (Write LaTeX Paper via `latex_bridge.py`) ```bash # 1. Run result-analyzer python result-analyzer/analyze.py ... -o report/ # 2. Convert JSON to latex-paper-skills format python result-analyzer/latex_bridge.py report/reproduction_report.json -o paper/results/ # This generates: # paper/results/main_results.csv โ† CSV for results-backfill # paper/results/main_results.tex โ† LaTeX table: \input{results/main_results.tex} # paper/results/reproduction_summary.tex โ† Summary text for abstract/conclusion # 3. In your paper: # \input{results/main_results.tex} % metric comparison table # \input{results/reproduction_summary.tex} % auto-written reproduction summary ``` ### โ† paper-parser (Input) ``` paper-parser outputs paper_content.json with tables โ†’ result-analyzer extracts paper metrics from tables โ†’ compares against reproduced values ``` ### โ† code-reproducer (Input) ``` code-reproducer outputs train_log.csv + generated images โ†’ result-analyzer loads CSV for curve comparison โ†’ compares images via SSIM/PSNR ``` ## Dependencies ```bash pip install -r result-analyzer/requirements.txt # Core: numpy, matplotlib, scikit-image, pandas # Optional: pytorch-fid (for FID score) ``` ## ๐Ÿ“š Reference URLs (for agent self-help) | Topic | URL | |-------|-----| | **scikit-image SSIM docs** | `https://scikit-image.org/docs/stable/api/skimage.metrics.html` | | **scikit-image PSNR docs** | `https://scikit-image.org/docs/stable/api/skimage.metrics.html` | | **pytorch-fid** | `https://github.com/mseitzer/pytorch-fid` | | **matplotlib savefig** | `https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.savefig.html` | | **pandas read_csv** | `https://pandas.pydata.org/docs/reference/api/pandas.read_csv.html` | | **latex-paper-skills** | `https://github.com/yunshenwuchuxun/latex-paper-skills` | | **results-backfill skill** | `https://github.com/yunshenwuchuxun/latex-paper-skills/tree/main/.codex/skills/results-backfill` | | **ML metrics overview** | `https://paperswithcode.com/task/image-generation` | ## Limitations - SSIM is sensitive to image alignment โ€” ensure consistent cropping - FID requires โ‰ฅ2048 images per directory for reliable scores - Table extraction depends on paper-parser JSON quality - Free-text metric extraction uses regex patterns โ€” may miss complex phrasing
View on GitHub