Seismic Selfie

Inspiration

The 2008 Chino Hills earthquake rattled millions of Southern California residents, yet most people have no tangible sense of how the ground actually moved beneath their own homes. Seismic data is abundant but abstract. Numbers and graphs don't convey the visceral fear of the shaking. We wanted to bridge that gap by transforming raw geophysical data provided by Scripps into a deeply personal, immersive experience that makes earthquake science unforgettable. The question driving us: What if you could relive the exact moment the ground shook under your house?

What it does

Seismic Selfie is an AI-powered immersive simulation that reconstructs the 2008 Chino Hills earthquake at your exact address. Enter your street address, and the app:

  • Locates your home and retrieves precomputed Peak Ground Velocity (PGV) data from a 400+ MB seismic grid as provided by Scripps.
  • Synthesizes a dynamic earthquake rumble whose intensity, frequency, and duration scale violently with the PGV. Low shakes are deep rumbles, high shakes become harsh structural crunches.
  • Uses a custom autoencoder neural network to detect anomalous waveforms, flagging locations that experienced unusually destructive ground motion.
  • Employs an ML damage model (Random Forest) to predict structural impact based on PGV and home age.
  • Generates a personalized cinematic voiceover with Google Gemini, then renders it with ElevenLabs using dynamically modulated panic settings. The voice's stability drops and style intensifies as shaking worsens.
  • Analyzes your home's Street View image using Gemini Vision to assign a visual risk score and identify vulnerabilities like soft-story garages or unreinforced masonry.
  • Mixes it all into a single immersive audio file where the narration trembles and distorts in sync with the synthetic earthquake.

The result is a 15‑second "seismic selfie", a chilling, scientifically grounded audio snapshot of what the ground did under your feet nearly two decades ago.

How we built it

We architected a multimodal pipeline spanning geospatial lookup, time‑series anomaly detection, generative AI, and audio synthesis:

  • Frontend: Streamlit with a custom cinematic CSS theme (dark seismograph grid, neon accents, VHS‑inspired "REC" indicator).
  • Geocoding & Street View: Google Maps API fetches coordinates and house imagery.
  • Seismic Data: A 400 MB CSV grid of precomputed PGV waveforms for the Chino Hills region from Scripps.
  • Anomaly Detection: A TensorFlow/Keras autoencoder trained on all 200+‑dimensional waveform arrays to compute reconstruction error; top 5% flagged as anomalous.
  • Damage Prediction: Scikit‑learn Random Forest classifier trained on synthetic earthquake‑engineering data (PGV vs. home age).
  • Audio Generation: Custom numpy/scipy synthesis engine that applies dynamic filtering, tremolo stutter, and saturation distortion based on PGV.
  • Voiceover: Google Gemini (3 Flash) writes a 15‑second cinematic script; ElevenLabs Text‑to‑Speech renders it with VoiceSettings modulated by PGV (lower stability, higher style, faster speed).
  • Audio Mixing: Pure NumPy signal processing mixes the voice array and rumble array, applies a tremolo "physical shake" to the voice at high PGVs, and exports a final WAV file.
  • Vision Analysis: Gemini Vision analyzes compressed Street View images and outputs JSON‑formatted risk assessments.

Challenges we ran into

  • Deployment Dependencies: Streamlit Cloud initially rejected tensorflow-cpu due to Python 3.14 incompatibility. We solved it by pinning Python 3.12 and switching to standard tensorflow.
  • Large File Hosting: Our 424 MB CSV exceeded GitHub's 100 MB limit. We implemented Git LFS and also built a Google Drive fallback using gdown for zero‑size‑limit deployments.
  • Real‑time Audio Mixing: Combining an 8 kHz PCM voice array with a 44.1 kHz rumble required precise resampling and envelope synchronization to avoid clipping or phase issues.
  • Voice Panic Modulation: ElevenLabs' VoiceSettings parameters aren't linear; we had to experiment to find the sweet spot where stability drops create audible urgency without sounding robotic.
  • Latency Optimization: Initial pipeline took 3 minutes due to sequential API calls. We added @st.cache_data, parallelized independent tasks, and pre‑trained all ML models offline to achieve sub‑second response times.

I wanted to host the website on streamlit cloud, I just ran into issues with the AI model and RAM blowing up.

Accomplishments that we're proud of

  • Zero‑Training Deployment: Pre‑trained models load instantly, making the app feel snappy and professional—critical for hackathon judging.
  • Visceral Audio Experience: The audio synthesis genuinely conveys the difference between a mild 2 cm/s roll and a catastrophic 8 cm/s shockwave. The voice trembles, the rumble distorts, and the result is unsettlingly realistic.
  • Multimodal AI Integration: Seamlessly blending seismic data science, computer vision, and generative audio within a single Streamlit app demonstrates technical depth rarely seen in a hackathon project.
  • Cinematic UI: The custom CSS transforms a default Streamlit form into an immersive "seismic surveillance" interface that wowed early testers.
  • Anomaly Detection Narrative: Flagging unusual waveforms gives users a compelling why behind their experience—"Your neighborhood shook differently."

What we learned

  • Streamlit's caching is a superpower: @st.cache_resource and @st.cache_data turned a 15‑second pipeline into an instant one.
  • TensorFlow model serialization: Saved .keras files are tiny and load reliably across environments, but Python version mismatches can break deployment.
  • ElevenLabs voice modulation is a hackathon goldmine: Dynamic stability and style parameters create an emotional arc without any extra audio processing. Free too!
  • Git LFS works beautifully with Streamlit Cloud—once configured correctly.

What's next for Seismic Selfie

  • Multi‑Fault Expansion: Add data for the San Andreas, Hayward, and Puente Hills faults, letting users simulate "The Big One" at any address.
  • Personalized Safety Recommendations: Integrate reinforcement learning to suggest optimal survival actions based on home structure and shaking intensity.
  • Social Sharing: Generate shareable "Seismic Report Cards" with a house's risk grade and a downloadable audio clip. It might go TikTok viral!
  • Mobile Companion App: A lightweight version that uses device accelerometers to simulate shaking in real‑time (with a disclaimer!).

Built With

Share this project:

Updates