GreaseGraph - Intelligent FTIR Spectroscopy Analysis Tool
Inspiration
The inspiration for GreaseGraph came from a real-world industrial challenge: monitoring grease quality in machinery is critical for preventing equipment failure, but traditional FTIR (Fourier-Transform Infrared) spectroscopy analysis is complex, time-consuming, and requires expert interpretation. We saw an opportunity to democratize this technology by creating an intelligent system that could instantly analyze spectral data and provide actionable insights—transforming what used to take hours of expert analysis into sub-second automated detection.
What it does
GreaseGraph is a production-ready FTIR spectroscopy analysis tool that monitors grease condition in industrial equipment. Instead of making subjective quality judgments, it uses a deviation-focused approach that reports factual spectral differences:
- Loads baseline and sample spectra from CSV files (single or batch)
- Analyzes deviations in critical regions (oxidation, water contamination, additive depletion)
- Detects chemical changes through horizontal peak shifts (ΔX) and intensity changes (ΔY)
- Categorizes conditions into actionable alerts: GOOD, REQUIRES_ATTENTION, CRITICAL, OUTLIER, or BASELINE_MISMATCH
- Generates interactive visualizations with matplotlib overlays showing exactly where spectra differ
- Exports professional reports with all metrics and graphs
The system provides multi-metric analysis combining correlation coefficients, vertical deviations (ΔY), horizontal shifts (ΔX), and their ratios to give maintenance teams clear, data-driven alerts about when grease needs attention.
How we built it
We built GreaseGraph using a hybrid numerical-AI architecture:
Core Technologies
- PyQt6 for the native desktop GUI with professional theming
- NumPy & SciPy for fast spectral analysis and statistical processing
- Matplotlib for high-quality scientific visualizations
- Pandas for CSV data handling
Analysis Pipeline
- FTIRDeviationAnalyzer (primary engine) – Pure numerical analysis using percentage-based thresholds (<10% normal, 10–30% attention, ≥30% critical) with 3σ statistical significance testing
- Multi-metric categorization – Combines correlation (r-value), ΔY intensity differences, ΔX peak shifts, and their ratio
- Critical region monitoring – Hard-coded zones for oxidation (1650–1800 cm⁻¹) and water contamination (3200–3600 cm⁻¹)
- Optional LLM translation – Converts technical metrics into user-friendly language without making quality judgments
Architecture decisions
- Moved from web-based (Streamlit) to desktop (PyQt6) for 3× faster startup and better responsiveness
- Implemented QThread workers for non-blocking UI during analysis
- Optimized from LLM-heavy (4–5 minutes per sample) to numerical-first (<1 second per sample) approach
- Attempted to integrate cloud GPUs but determined they would not offer meaningful performance improvements and abandoned the idea
- Built comprehensive export system with PNG, PDF, and data reports
Challenges we ran into
Performance optimization: Initially, analysis times ranged from 4–5 minutes per sample. Through successive optimization stages, we reduced this to 2–3 minutes, then 30 seconds, and finally achieved a consistent 1-second runtime per sample.
Cloud GPU feasibility: We explored leveraging cloud GPUs for faster computation but found that the benefits were negligible for our numerical approach and decided to focus on algorithmic efficiency instead.
Threshold calibration: Determining the right thresholds for GOOD vs CRITICAL required deep domain expertise. We iterated with industrial feedback to establish percentage-based thresholds (10%, 30%, 50%) that align with real-world grease degradation patterns.
Baseline compatibility: Early versions couldn’t detect when users compared incompatible grease types. We implemented automatic formulation mismatch detection using correlation and ratio analysis.
UI responsiveness: PyQt6 was new territory for us. We learned to implement proper threading with QThread and signal/slot communication to keep the GUI responsive during batch analysis.
Statistical rigor: Avoiding false positives from noise while catching real deviations required implementing 3σ significance testing and dynamic outlier detection across the full spectrum.
Accomplishments that we're proud of
- Sub-second analysis speed – Optimized from several minutes to under one second per sample
- Production-ready reliability – 100% deterministic analysis with no dependency on external LLM services
- Multi-metric intelligence – Combines four different analytical approaches (correlation, ΔX, ΔY, ratio) for robust categorization
- Real-world validation – Tested with actual FTIR data from industrial grease samples
- Professional desktop application – Native UI with batch processing, interactive graphs, and export capabilities
- Distributable executable – Built PyInstaller spec for easy deployment without Python installation
What we learned
Talking to experts in the field helped tremendously. Due to the insights shared by the MRG President and Mr. Steve, we were able to make rapid and meaningful improvements to our program.
We also learned that:
- Domain expertise matters – Working with FTIR spectroscopy required deep understanding of chemistry and signal processing.
- Performance optimization techniques – Profiling, identifying bottlenecks, and replacing slow LLM calls with fast numerical algorithms drastically improved performance.
- PyQt6 development – We mastered threading, signal/slot patterns, and custom widget creation for scientific applications.
- Balancing accuracy and speed – We found the right balance between analytical depth and practical usability.
- Statistical analysis – Implemented proper significance testing, outlier detection, and multi-metric decision logic.
What’s next for GreaseGraph
- Machine learning enhancement – Train models on labeled datasets to improve adaptive thresholding across different grease families.
- Integrated chatbot assistant – Provide real-time inferences and interpretations of spectral data within the program.
- Advanced reporting – Generate comprehensive, compliance-ready analytical summaries for industry use.
- Enhanced analytical logic – Further refine the internal logic for even greater accuracy and precision in spectral deviation detection.

Log in or sign up for Devpost to join the conversation.