A comprehensive GUI application for automated photonic integrated circuit (PIC) layout verification using AI-powered discontinuity detection.
- GDS File Processing: Load and analyze GDS layout files
- SVG Conversion: Automatic conversion from GDS to SVG format
- Tile-Based Analysis: Split large layouts into manageable tiles for detailed inspection
- AI-Powered Detection: Uses Google's Gemini models for intelligent discontinuity detection
- Interactive Classification: Manual review and classification of detected issues
- Virtual Tile System: On-demand tile generation with intelligent caching
- Region of Interest (ROI): Focus analysis on specific layout areas
- Multi-threaded Processing: Configurable CPU usage for optimal performance
- Real-time Preview: Interactive navigation with coordinate transformation
- Comprehensive Export: JSON export with complete analysis metadata
- Dual-Panel Layout: Controls on left, original layout visualization on right
- Interactive Canvas: Click navigation, ROI drawing with blue boxes, and colored tile status overlays
- Visual Status Indicators: Color-coded dots (π’/π΄/π ) showing AI classification results
- Responsive Design: Components scale proportionally with window resizing
- Progress Tracking: Real-time analysis progress with pause/resume capability
- Enhanced Navigation: Previous/Next buttons with keyboard shortcuts for tile review
- Python 3.8+ (Recommended: Python 3.9 or higher)
- Operating System: macOS, Linux, or Windows
- Memory: 4GB RAM minimum, 8GB+ recommended for large layouts
- Storage: 1GB free space for temporary files and caching
- Google API Key: Required for AI analysis functionality
- Get your key from Google AI Studio
One-command automated installation:
# Clone repository
git clone https://github.com/nguyennm1024/ai-photonic-physical-verification.git
cd ai-photonic-physical-verification
# Run automated installer (macOS, Ubuntu/Debian, Fedora)
./install.sh
# Setup your Google API key
./setup_api_key.sh
# Start the application
python3 main.py
That's it! The script automatically installs:
- Python 3.11 and dependencies
- Tcl/Tk GUI libraries
- SVG converter (librsvg)
- All Python packages
- Operating System: macOS, Ubuntu/Debian, or Fedora
- Google API Key: Get FREE key from Google AI Studio
- 5-10 minutes for installation
If you prefer manual installation or use Windows:
# Clone and install
git clone https://github.com/nguyennm1024/ai-photonic-physical-verification.git
cd ai-photonic-physical-verification
pip install -e .
# Set API key
export GOOGLE_API_KEY='your_api_key_here'
# Install SVG converter
brew install librsvg # macOS
# OR
sudo apt-get install librsvg2-bin # Ubuntu/Debian
# Verify installation
python test_modules.py
Guides:
- π First time? See QUICKSTART.md (3 simple steps!)
- π§ Detailed setup: See INSTALLATION.md
- β Troubleshooting: See INSTALLATION.md#troubleshooting
python main.py
Note: The old
layout_verification_app.py
has been renamed tolayout_verification_app_OLD.py
. Usemain.py
for the refactored version.
- Load GDS File: Click "Load GDS File" and select your layout file
- Configure Grid: Set tile grid size (default 50Γ50), overlap (default 0%)
- Generate Grid: Click "Generate Grid" to prepare the tile system
- Select Region (Optional):
- Click "Select ROIs" to enable ROI mode (button turns to "β Selecting ROIs")
- Draw blue boxes on the layout to select specific regions
- Select multiple regions without re-clicking the button
- Start AI Analysis:
- Click "Process All Tiles" for full layout analysis
- Or "Process Selected Regions" for ROI-only analysis
- Review Results:
- View colored tile overlays on layout (green/red boxes)
- Click any tile to see details in the review panel
- Status indicators show π’ Continuity, π΄ Discontinuity, or π No waveguide
- Use Previous/Next buttons to navigate through tiles
- Manual Classification: Classify tiles as "β Continuous" or "β Discontinuity"
- Export Results: Save analysis results to JSON format
Tips:
- Use ROI selection for focused analysis of critical areas
- Click "Cancel Processing" to pause at any time
- Resize window to adjust UI layout proportionally
Modular Structure:
core/
- Business logic (file management, tile system, AI analyzer, ROI manager, state)utils/
- Coordinate transformations, image processing, thread-safe communicationui/
- Reusable components, event handlers, styling
The clean interface showing the dual-panel layout with controls on the left and interactive layout visualization on the right.
- INSTALLATION.md - Complete installation guide with troubleshooting
- docs/REFACTORING_DESIGN.md - Architecture & design details
Dual Model Architecture:
- Gemini Pro for detailed analysis and reasoning
- Gemini Flash for fast three-category classification
Analysis Pipeline:
- Tile Generation: Create analysis-ready image tiles with resolution-aware caching
- AI Processing: Send tiles to Gemini Pro for detailed analysis
- Classification: Three-category classification using Gemini Flash:
- Continuity - Waveguides are continuous and properly aligned
- Discontinuity - Breaks, gaps, misalignments, or structural issues detected
- No Waveguide - No actual waveguides found in the tile
- Visual Feedback: Colored overlays on layout and status indicators in review panel
- Result Storage: Store detailed analysis, classification, and coordinates
- User Review: Manual verification and correction with Previous/Next navigation
Common Issues:
- Installation errors β See INSTALLATION.md
- Tile generation fails β Install rsvg-convert or inkscape
- Memory issues β Reduce grid size, use virtual tiles
- Analysis errors β Check API key configuration
# Configuration for quick analysis
Grid Size: 10Γ10
Tile Resolution: 512px (AI), 384px (preview)
CPU Cores: 4
Virtual Tiles: Enabled
ROI Analysis: Optional - select specific areas
# Default configuration - optimal for most cases
Grid Size: 50Γ50
Tile Overlap: 0%
Tile Resolution: 512px (AI), 384px (preview)
CPU Cores: 8
Cache Size: 100 tiles
Virtual Tiles: Enabled
# Configuration for comprehensive analysis
Grid Size: 80Γ80
Tile Resolution: 1024px
CPU Cores: 8
Virtual Tiles: Enabled
ROI Analysis: Highly recommended - focus on critical areas first
Preview Resolution: 384px for faster navigation
We welcome contributions! Here are some areas where you can help:
- Performance optimization for large layouts
- Additional AI models integration
- Export format extensions
- UI/UX improvements
- Documentation enhancements
- Fork the repository and create a feature branch
- Follow INSTALLATION.md for setup
- Review docs/REFACTORING_DESIGN.md for architecture
- Make your changes with tests
- Submit a pull request
This project is open source. Please see the license file for details.
Current Version: 2.1.0 Status: Active Development Last Updated: October 2025
v2.1 (October 2025) - UI/UX Enhancements:
- Visual status indicators (π’/π΄/π ), responsive design, enhanced ROI selection
- Accurate coordinate transformation, resolution-aware caching
- Three-category classification, updated defaults (50Γ50 grid)
v2.0 (October 2025) - Major Refactoring:
- Modular architecture with 24+ modules, comprehensive testing
- Validated with real 4.5MB GDS files
v1.0 (August 2025) - Initial Release:
- Complete GUI with AI-powered discontinuity detection