Inspiration
On 24 May 2019, a fire in a Surat coaching centre killed 22 students, aged 15 to 22. The classes were held on the top floor, and the only way down was a wooden staircase. When the fire reached it, the students were trapped, and several jumped from the building. Reports said the building had no fire safety equipment and no real escape route.
It wasn't the first time. In 2004, 94 children died in the Kumbakonam school fire, after which the Supreme Court told schools to follow strict fire-safety rules.
What stays with us is that the danger was visible before the fire. One exit, a flammable staircase, and a crowded room are things a person can see, but nobody was looking at the space the way an evacuation would. Every day, millions of students sit in classrooms, coaching centres and libraries where the way out is narrow, blocked or cluttered. Most of these spaces are never formally inspected, and the people in them can't tell if they are safe.
We built LifeLens AI so that anyone with a phone camera can ask: "If something went wrong here, could everyone get out?"
What it does
LifeLens AI takes up to 8 photos of a room and turns them into a spatial safety review:
- Scores the space from 0 to 100 on safety, accessibility, movement and organization.
- Finds problems such as blocked exits, narrow pathways, trip hazards, clutter and furniture that traps people, each with a severity level.
- Marks each issue on the photo where the AI sees it, so you can see exactly what is wrong.
- Explains why it matters and gives practical, prioritized recommendations.
- Shows the fix: one click generates an image of the same room with the problems resolved, so people can see the safer version before they move a single desk.
- States what it can't tell, listing what can't be judged from the photos instead of guessing.
How we built it
- Frontend: React and Vite, with a responsive dashboard that overlays issue markers on the uploaded photos.
- Backend: Node.js and Express. The server sends the photos to Google Gemini's vision models with a strict prompt: only report what is visible, never invent exits or measurements, and return structured JSON.
- Analysis: The response contains scores, issues with severity and image coordinates, recommendations and uncertainties. The server validates and cleans all of it before the frontend uses it.
- Optimization: The detected issues and fixes are sent with the photo to a Gemini image model, which generates the same room with every problem resolved.
- Reliability: The server tries several Gemini models in order. If one hits its quota or fails, it automatically switches to the next, so one limit doesn't break the experience.
Challenges we ran into
- Free-tier quotas. Each model allows only a few requests per minute and per day, so we built automatic model switching with a cooldown for exhausted models.
- Honest AI. Vision models like to guess. We had to write the prompt so the model reports only visible evidence and says when it can't tell.
- Locating problems. Our first version placed markers at fixed positions. We changed it so the model returns coordinates for each issue and the markers appear where the problem actually is.
- Image generation that stays faithful. The "after" image must look like the same room, not a new one, so the prompt tells the model to keep the architecture, camera angle and lighting and change only what is needed.
What we learned
- Useful AI products come from asking a better question, not only from recognizing objects. LifeLens asks whether a space works for the people in it.
- Structured output and validation matter as much as the model. Without them, one malformed response breaks the whole interface.
- A fallback plan for every external dependency, such as quotas and model outages, is part of building something people can rely on.
What's next
- Check the generated "after" image with a second analysis so the improved score is measured, not estimated. Right now the projected score is an estimate.
- Compare findings against fire and accessibility standards such as the National Building Code of India.
- Support video walkthroughs and emergency "what if 30 people leave at once?" simulations.
- Offer the tool to schools, coaching centres, hospitals and offices.
An important note
LifeLens AI is an AI-assisted aid based on photographs. It is not a certified safety inspection and does not replace a qualified fire-safety audit. Its purpose is to help people notice problems early and ask for proper inspection.
In memory of the students who lost their lives because there was no safe way out.
Built With
- computer-vision
- cors
- css3
- doten
- express.js
- gemini-api
- generative-ai
- google-gemini
- google-genai
- html5
- javascript
- lucide-react
- node.js
- react
- vite
Log in or sign up for Devpost to join the conversation.