--- license: apache-2.0 tags: - reinforcement-learning - tabular-regression - xgboost - pytorch - stable-baselines3 - femtosecond-laser - hydrogel - GelMA - HAMA - laser-machining - SAC - materials-science - manufacturing - ml-intern pipeline_tag: reinforcement-learning datasets: - TWLAb/femtosecond-laser-hydrogel-etching-data --- # Femtosecond Laser Hydrogel Etching - RL-Optimized Model v2 ## ๐Ÿ”ฌ Overview An ML system combining a **surrogate prediction model** (XGBoost + Neural Network ensemble) with a **Reinforcement Learning optimizer** (SAC) for femtosecond laser hydrogel etching parameter optimization. **Focus materials: GelMA and HAMA** (65% of 12,000 training samples) ## Architecture ``` โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ SAC RL Agent (Parameter Optimizer) - 100% Success Rate โ”‚ โ”‚ โ€ข Observes: current params + predicted geometry + target โ”‚ โ”‚ โ€ข Actions: parameter deltas (ยฑ15% of range per step) โ”‚ โ”‚ โ€ข Reward: improvement + proximity + goal bonus โ”‚ โ”‚ โ€ข Converges in ~4 steps to target geometry โ”‚ โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค โ”‚ XGBoost + NN Ensemble (Surrogate Environment) โ”‚ โ”‚ โ€ข XGBoost: 600 trees, depth 7, per-target โ”‚ โ”‚ โ€ข Neural Network: [128, 64, 32], BatchNorm, Dropout โ”‚ โ”‚ โ€ข Weighted ensemble: 60% XGB + 40% NN โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ ``` ## Performance ### Surrogate Model (Geometry Prediction) | Target | Rยฒ | MAE | |--------|-----|-----| | etch_depth_um | **0.9745** | 1.05 ยตm | | etch_width_um | **0.9845** | 2.33 ยตm | | surface_roughness_Sa_um | 0.8409 | 28.18 | | aspect_ratio | 0.7074 | 0.49 | | side_wall_angle_deg | **0.9326** | 4.03ยฐ | ### RL Optimizer (SAC v2 - Depth + Width Focus) | Metric | Value | |--------|-------| | **Success rate** | **100%** | | Avg relative error | 0.107 | | Avg absolute error | 2.60 ยตm | | Convergence speed | ~4 steps | | Algorithm | SAC (ฮณ=0.7, lr=1e-3) | | Training timesteps | 20,000 | ## Design Principles (from literature) Based on published RL-for-laser research: - **SAC** dominates PPO/TD3 for continuous laser control ([TempoRL, arxiv:2304.12187](https://arxiv.org/abs/2304.12187)) - **Delta actions** (ยฑ15% of param range/step) for machine safety ([arxiv:2503.00499](https://arxiv.org/abs/2503.00499)) - **ฮณ = 0.7** optimal for episodic manufacturing control (not 0.99) - **Potential-based reward shaping** with improvement signal + proximity bonus - **Domain randomization**: material + target randomized each episode ## Supported Materials (18 variants) ### GelMA (40% of data) | Variant | Water Content | Threshold Fluence | Young's Modulus | |---------|--------------|-------------------|-----------------| | GelMA 5% | 92% | 1.8 J/cmยฒ | 3.5 kPa | | GelMA 7% | 89% | 1.4 J/cmยฒ | 8 kPa | | GelMA 10% | 85% | 1.0 J/cmยฒ | 18 kPa | | GelMA 15% | 80% | 0.7 J/cmยฒ | 45 kPa | | GelMA 20% | 75% | 0.5 J/cmยฒ | 90 kPa | ### HAMA (25% of data) | Variant | Water Content | Threshold Fluence | Young's Modulus | |---------|--------------|-------------------|-----------------| | HAMA 1% | 96% | 2.5 J/cmยฒ | 1.2 kPa | | HAMA 2% | 94% | 2.0 J/cmยฒ | 3.5 kPa | | HAMA 3% | 92% | 1.6 J/cmยฒ | 8 kPa | | HAMA 5% | 88% | 1.2 J/cmยฒ | 20 kPa | ### GelMA-HAMA Composites (20% of data) GelMA5+HAMA1, GelMA7+HAMA2, GelMA10+HAMA3, GelMA15+HAMA5 ### Other Materials (15% of data) PEG, PEGDA, Collagen, Alginate, Silk fibroin ## Input Features (21 total) ### Laser Parameters (8) `power_mW`, `repetition_rate_kHz`, `scan_speed_mm_s`, `pulse_duration_fs`, `wavelength_nm`, `num_passes`, `spot_diameter_um`, `focal_offset_um` ### Material Properties (9) `water_content`, `threshold_fluence_J_cm2`, `absorption_depth_nm`, `incubation_coefficient`, `refractive_index`, `youngs_modulus_kPa`, `degree_of_methacrylation`, `crosslink_density_mol_m3`, `two_photon_cross_section_GM` ### Derived Physics Features (4) `pulse_energy_uJ`, `peak_fluence_J_cm2`, `effective_pulses`, `overlap_percent` ## Usage ### Predict etching geometry: ```python import xgboost as xgb, torch, joblib, numpy as np # Load models scaler_X = joblib.load("scaler_X.joblib") scaler_y = joblib.load("scaler_y.joblib") xgb_models = {t: xgb.XGBRegressor() for t in targets} for t in targets: xgb_models[t].load_model(f"xgb_{t}.json") # Predict features = [200, 1000, 1.0, 200, 800, 5, 10, 0, ...] # 21 features xgb_pred = np.array([xgb_models[t].predict([features])[0] for t in targets]) ``` ### Optimize parameters with RL: ```python from stable_baselines3 import SAC sac = SAC.load("sac_optimizer_v2") # Set target: depth=10ยตm, width=20ยตm # Agent finds optimal: power, rep_rate, speed, passes, spot_diameter obs = env.reset(target=[10, 20]) for step in range(20): action, _ = sac.predict(obs, deterministic=True) obs, reward, done, _, info = env.step(action) if done: break # Optimized params available in env.params ``` ## Dataset **12,000 samples** with physics-informed synthetic data grounded in: - Beer-Lambert ablation model with two-photon absorption - Gaussian beam width model - Material-specific incubation effects - Literature-validated parameter ranges Available at: [TWLAb/femtosecond-laser-hydrogel-etching-data](https://huggingface.co/datasets/TWLAb/femtosecond-laser-hydrogel-etching-data) ## Scientific References 1. Petit et al., "AI-Supported Prediction of Femtosecond Laser Micromachining Parameters", JLMN 2025 2. "TempoRL: Laser Pulse Temporal Shape Optimization with DRL", [arxiv:2304.12187](https://arxiv.org/abs/2304.12187) 3. Capuano et al., "Shaping Laser Pulses with RL", [arxiv:2503.00499](https://arxiv.org/abs/2503.00499) 4. "Optimizing Operation Recipes with RL", [arxiv:2511.16297](https://arxiv.org/abs/2511.16297) 5. Femtosecond laser induced densification within cell-laden hydrogels, Biofabrication 2019 6. Femtosecond Laser Densification of Hydrogels, ACS Appl. Mater. Interfaces 2022 7. Harnessing the potential of HAMA hydrogel, Bioactive Materials 2024 8. Behbahani et al., "ML-driven laser machining of alumina ceramics", Physica Scripta 2023 ## Generated by ML Intern This model repository was generated by [ML Intern](https://github.com/huggingface/ml-intern), an agent for machine learning research and development on the Hugging Face Hub. - Try ML Intern: https://smolagents-ml-intern.hf.space - Source code: https://github.com/huggingface/ml-intern