More about Omdena
Omdena is an innovation platform for building AI solutions to real-world problems through the power of bottom-up collaboration.
Is it possible to estimate with minimum expert knowledge if your street will be safer than others when an earthquake occurs?
We answered how to estimate the safest route after an earthquake with computer vision and route management.
The last devastating earthquake in Turkey occurred in 1999 (>7 on the Richter scale) around 150–200 kilometers from Istanbul. Scientists believe that this time the earthquake will burst directly in the city and the magnitude is predicted to be similar.
The main motivation behind this AI project hosted by Impacthub Istanbul is to optimize the Aftermath Management of Earthquake with AI and route planning.
After kicking off the project and brainstorming with the hosts, collaborators, and the Omdena team about how to better prepare the city of Istanbul for an upcoming disaster, we spotted a problem quite simple but at the same time really important for families: get reunited ASAP in earthquake aftermath!
Our target was set to provide safe and fast route planning for families, considering not only time factors but also broken bridges, landing debris, and other obstacles usually found in these scenarios.
We resorted to working on two tasks: creating a risk heatmap that would depict how dangerous is a particular area on the map, and a path-finding algorithm providing the safest and shortest path from A to B. The latter algorithm would rely on the previous heatmap to estimate safeness.
Challenge started! Deep Learning for Earthquake management by the use of Computer Vision and Route Management.
By this time, we optimistically trusted in open data to successfully address our problem. However, we realized soon that data describing buildings quality, soil composition, as well as pre and post-disaster imagery, were complex to model, integrate, when possible to find.
Bridges over streets, buildings height, 1000 types of soil, and eventually, interaction among all of them… Too many factors to control! So we just focused on delivering something more approximated.
The question was: how to accurately estimate street safeness during any Earthquake in Istanbul without such a myriad of data? What if we could roughly estimate path safeness by embracing distance-to-buildings as a safety proxy. The farther the buildings the safer the pathway.
For that crazy idea, firstly we needed buildings footprints laid on the map. Some people suggested borrowing buildings footprints from Open Street Map, one of the most popular open-source map providers. However, we noticed soon Open Street Map, though quite complete, has some blank areas in terms of buildings metadata which were relevant for our task. Footprints were also inaccurately laid out on the map sometimes.
A big problem regarding the occurrence of any Earthquake and their effects on the population, and we have Computer Vision here to the rescue! Using Deep Learning, we could rely on satellite imagery to detect and then, estimated closeness from pathways to them.
The next stone on the road was to obtain high-resolution imagery of Istanbul. With enough resolution to allow an ML model locates building footprints in the map as a standard-visually-agile human does. Likewise, we would also need some annotated footprints on these images so that our model can gracefully train.
Instead of labeling hundreds of square meters manually, we trusted on SpaceNet (and in particular, images for Rio de Janeiro) as our annotated data provider. This dataset contains high-resolution satellite images and building footprints, nicely pre-processed and organized which were used in a recent competition.
The modeling phase was really smooth thanks to fast.ai software.
We used a Dynamic Unit model with an ImageNet pre-trained resnet34 encoder as a starting point for our model. This state-of-the-art architecture uses by default many advanced deep learning techniques, such as a one-cycle learning schedule or AdamW optimizer.
All these fancy advances in just a few lines of code.
We set up a balanced combination of Focal Loss and Dice Loss, and accuracy and dice metrics as performance evaluators. After several frozen and unfrozen steps in our model, we came up with good-enough predictions for the next step.
For more information about working with geospatial data and tools with fast.ai, please refer to .
Finding high-resolution imagery was the key to our model and at the same time a humongous stone hindering our path to victory.
For the training stage, it was easy to elude the manual annotation and data collection process thanks to SpaceNet, yet during prediction, obtaining high-res imagery for Istanbul was the only way.
Thankfully, we stumble upon Mapbox and its easy-peasy almost-free download API which provides high-res slippy map tiles all over the world, and with different zoom levels. Slippy map tiles are 256 × 256 pixel files, described by x, y, z coordinates, where x and y represent 2D coordinates in the Mercator projection, and z the zoom level applied on earth globe. We chose a zoom level equal to 18 where each pixel links to real 0.596 meters.
As they mentioned on their webpage, they have a generous free tier that allows you to download up to 750,000 raster tiles a month for free. Enough for us as we wanted to grab tiles for a couple of districts.
Once all required tiles were stealing space from my Google Drive, it was time to switch on our deep learning model and generate prediction footprints for each tile.
Then, we geo-referenced the tiles by translating from the Mercator coordinates to the latitude-longitude tuple (that used by mighty explorers). Geo-referencing tiles was a required step to create our prediction piece of art with GDAL software.
gdal_merge.py thecommand allows us to glue tiles by using embedded geo-coordinates in TIFF images. After some math, and computing time… voilà! Our high-res prediction map for the district is ready.
Ok, I see my house but should I go through this street?
Building detection was not enough for our task. We should determine distance from a given position in the map to the closest building around so that a person in this place could know how safe is going to be to cross this street. The larger the distance the safer, remember?
The path-finding team would overlay the heatmap below on his graph-based schema and by intersecting graph edges (streets) with heatmap pixels (user positions), they could calculate the average distance for each pixel on the edge and thus obtaining a safeness estimation for each street. This would be our input when finding the best A-B path.
If a pixel belongs to some building, it returns zero. If not, return the minimum euclidean distance from the center point to the building’s pixels. This process along with NumPy optimizations was the key to mitigate the quadratic complexity beneath this computation.
Repeat the process for each pixel and the safeness map comes up.
Omdena is an innovation platform for building AI solutions to real-world problems through the power of bottom-up collaboration.
From a broad problem statement to a functional AI prototype in only two months to unite families in the aftermath of an earthquake.
Article written by Laura Clark Murray.
Since the devastating 1999 earthquake in Istanbul that killed more than 18,000 people and left half a million homeless, experts have been warning about the need to prepare for another major earthquake.
Late in 2019, a group of changemakers in the heart of Istanbul were looking to embark on a new project, in which they could apply innovative AI technology to solve a major issue for their local community. Well aware of the predictions that a major quake could hit at any time, these members of Impact Hub Istanbul, part of a global community focused on social innovation, decided to concentrate on response efforts in the immediate aftermath of an earthquake.
Impact Hub Istanbul pulled in Omdena for our proven expertise in quickly transforming vague problem definitions into well-defined AI use cases. Omdena is a global platform where AI experts, engaged citizens and aspiring data scientists from diverse backgrounds collaborate to build AI-based solutions to humanity’s toughest problems. In our eight-week challenges, a community of 40 to 50 collaborators from around the world delivers deployable solutions using real-world data.
You can learn more about Omdena’s innovative approach to building AI solutions through global collaboration here. Our partners include the UN, non-profit organizations and private corporations. In less than a year since our founding, over 700 AI enthusiasts from 70 countries have come together on Omdena challenges to solve social problems related to hunger, PTSD, sexual harassment, gang violence, wildfire prevention, and energy poverty.
With the Omdena collaborators on board, the team considered the human experience of surviving an earthquake. They recognized a simple but significant dilemma. If family members are in different locations when an earthquake hits, as is the case when children are at school and parents are at work, reuniting is their highest priority. And that can be a terrifying prospect when it’s unclear how to safely navigate a city amid damage and destruction.
Could an AI system be built, using machine learning techniques, that would provide safe and fast route planning to reunite families in the hours after an earthquake hits?
We find that the best way to know if machine learning can solve a problem is to get out of the lab. By brainstorming with a diverse group of collaborators who bring different perspectives and expertise, potential solutions to a problem emerge. Modeling these alternative approaches using real-world data tells us what works.
Together with Impact Hub Istanbul, we explored many alternate strategies for route planning. It was clear that parents and children should take paths that are likely to be safe after an earthquake. However, we needed to define what “safe” means in this context and then find the data required to assess it.
Collaborator Nguyen Tran shares the internal debates about framing the problem in his article on the challenge.
As is often the case in real-world situations, the ideal data didn’t exist. When we uncover data roadblocks — nonexistent, incomplete or inaccurate data — we invent ways to get around them. The domain expertise of our partners and the creativity of our diverse collaborators come into play. Semih Boyaci, Co-Founder of Impact Hub Istanbul, sees the benefit of working with an inclusive team: “As different community members contribute to the solutions, a significant level of diversity is integrated into the solutions. This not only prevents potential errors in a timely manner but also brings a higher level of creativity to the challenge process.”
Through this collaborative and iterative process, we are able to start with a vague question and quickly refine it to one that is clear and actionable. And in the process, build a solution.
The goal was to create a prototype to accurately predict and verify safe routes between schools, hospitals, workplaces, and homes in one region of Istanbul. Focusing on the city’s Fatih District, the team pulled together and crafted data on the buildings and streets and built a model that calculated a risk score for each section of the district. Using various algorithms, the model identifies the shortest and safest path between two locations.
You can learn more about the data science behind this project from collaborator Sergio Ramírez Gallego.
Building a prototype is a low-risk way to assess the applicability of AI techniques to a broad problem area and establish a direction for further investment and resources. Collaborator David Tran shares, “In a span of two months, we’ve explored the boundaries of the solution space, navigated through the limitations in data availability and technical complexity, and arrived at a functional solution.”
With a proof-of-concept in-hand, Impact Hub Istanbul has defined a concrete way to have an impact on earthquake response in their city using AI.
Just as the project wrapped up in the last weeks of January its relevance was underscored when a 6.7 magnitude earthquake shook eastern Turkey, tragically killing at least 30 people and injuring more than 1600 — further motivating the Impact Hub Istanbul team to turn the prototype into a deployable application that incorporates all the districts of Istanbul. Before the next earthquake hits.
“The result of this stunning process with Omdena was an AI-powered tool that helps families reunite in case of an earthquake by calculating the shortest and safest roads. It was really incredible to witness the productivity level when a group of talented people comes together around common motivations to solve problems for the social good. I believe that this is the way of working that all companies need to achieve in order to work with new generations.”
— Semih Boyaci, Co-Founder, Impact Hub Istanbul
Uniting families through Artificial Intelligence and Open Street Map data by finding safe routes in the aftermath of an earthquake.
Article written by Anju Mercian.
There has been a lot of research to predict earthquakes and how to increase safety during an earthquake. A question that has remained relatively unexplored is what happens after an earthquake? And how can Artificial Intelligence help?
The aftermath of an earthquake comes with a lot of challenges:
The last question is a big issue to tackle, which we focused on in this challenge.
Scientists predict that there will be an earthquake in Istanbul in the near future but the exact date is difficult to identify since Istanbul resides on a fault line. This means there is a possibility of major destruction.
Keeping families together and safe is the number one priority.
The problem-to-be-solved was proposed by Impacthub Istanbul, which wanted to collaborate with Omdena to leverage their AI capabilities and community to move from a broad problem statement to a functional AI solution.
Here is a non-technical summary of the challenge.
How did we go about this?
We used all the data from OSMX; the latitude, longitude data, edges, nodes.
Problems we faced
For a more technical understanding of the challenge check out this article.
Neither I’m an expert in the aftermath management of an earthquake nor was I an expert on network analysis using Artificial Intelligence.
I had gotten to know of Omdena through a friend on Social Media.
I was inspired by their vision of Building AI for Good through a collaborative environment and wanted to be a part of their challenge.
This project was a great learning experience. I joined this challenge not knowing how to solve this problem but the collaborative learning environment made it possible.
I had an understanding that Artificial Intelligence and Machine Learning was a vast field, but this project gave me an opportunity to experience it first hand.
Collaborating with my teammates across timezones helped me to co-ordinate my schedule more effectively, as well as learn from diverse perspectives.
Thanks to a very supportive team.
How to use Machine Learning for identifying the safest route after an earthquake.
Article written by Nguyen Tran.
Close your eyes for a moment. Imagine a nice day like any other nice day. The Sun is shining on the sea, and birds are singing in the trees. Suddenly, the trees start to shake, and the chair you’re sitting on is also shaking. You look around and begin to notice the confusion on the faces of your colleagues transitioning to dread: an earthquake is happening.
Remembering the drills, you take refuge under the cover of your work desk as objects around you fall from their places onto the ground. You pray for your life and the lives of those you love.
Seconds feel like minutes, and minutes feel like hours.
But at last, it was over. You thank for your life, but you felt an overwhelming need to ask for more than just your own safety as a surge of anxiety takes hold of you: Are your families OK? Your mind fixates on one thing: You MUST get to them, and that takes priority over anything else.
Well, you, the reader, are probably right in that the scenario above is a bit overly dramatic, but it is hard to overstate the level of distress natural disasters, such as an earthquake, can cause to people.
And all participants in the Istanbul Earthquake Challenge share a similar sense of urgency and seriousness in finding ways to improve the situation for the earthquake victims.
That’s why early on in the challenge, we decided to focus to apply machine learning for the aftermath of an earthquake.
The aftermath of the earthquake might see communication cut-off or made extra difficult, causing problems with coordination between family members. Roads might be damaged and/or blocked up by debris falling from buildings. Traveling in the post-earthquake scenario will be chaotic and dangerous, but it won’t deter people from trying to reach their loved ones.
It took our community of collaborators a fair bit of meandering exploration and a few fierce internal debates to finally boil the problem down to three main components: a) the representation of riskiness, b) the path-finding component, and c) the integration of a) and b).
This part proved to be a tricky part from the very start. Many team members devoted much time into gathering data that might contain some information regarding riskiness in the aftermath of an earthquake. We looked into various types of heatmaps: soil-composition heatmap, elevation heatmap, population heatmap, seismic hazard map,… but we faced two problems here.
First is the problem of sparsity of data. The resolutions of the heatmaps are both low (meaning a single value maps over a very large area) — therefore resulting in low precision, and mismatched — thus forcing us to interpolate and introduce high level of uncertainty. Second is the problem of accurately modeling the level of risks. Not unlike trying to predict the earthquake itself, we could not find enough labeled data to comfortably make riskiness-prediction a supervised learning exercise. After a lot of persistence but fruitless efforts, we finally realized that this component of the problem needs a fresh approach that does not follow the well-trodden path of seismology.
A breakthrough came when a small group of members discussed the idea of using something concrete as a proxy for the abstract idea of safeness (which is the inverse of the abstract concept of riskiness). Safeness is a much more intuitive concept to a human’s mind. Safeness is also deducible from the observable surrounding: After an earthquake, it’s safer to stick to larger roads, and it’s safer to keep to areas with open-air.
And so, we arrived at the two proxies for safeness:
Areas with lower building density are safer areas, so paths that run through these areas should be less risky. Similarly, wide streets are safer streets, so paths that move along these streets are also less risky. Two task groups were quickly formed to collect satellite images of the city and extract from them street masks and building masks using two newly trained image segmentation models.
After this, distance-transformation is applied on the prediction mask, giving us a rasterized map in which each pixel represents either the distance from a nearby building (in other words, how open is the space) or the distance from the side edge of the road (after some data aggregation, the road’s width).
You can read more about the segmentation models here.
This part was a great deal more straight forward than the previous part. Path-finding is a very well-established and well-tuned area of Machine Learning.
So, very early into the challenge, multiple demos were uploaded, leveraging the existing graphs of streets and intersections made available by the Open Street Map project. The initial demos used randomly-generated dummy risk data and attempted to find path based on singular objective either minimizing length or minimizing risk. Q-learning, Dijkstra, and A-star were the algorithm used. Later, the Graph ML team also successfully looked into a Multi-objective path-finding algorithm based on A-star algorithm with some tweaks that check for Pareto efficiency on every search iteration.
A problem arose when testing the algorithm on large graphs made of multiple city districts: computation time increased dramatically as the number of nodes and edges ballooned.
A solution was proposed to prune nodes and edges using a hierarchical approach to path-finding. Rather than ingesting the entire city graph, a helper algorithm finds a path on a district level; the district-to-district pathings are fed to another helper algorithm that looks for the path on a neighborhood level. On the last level is the street-level graph constructed at a much-reduced size compared to the non-hierarchical approach. The smaller graph, with fewer nodes and edges, ensures that computation time remains reasonable even in the case of finding a path across the entire city.
A working solution needs to be more than the sum of its parts, and integration is the process of realizing that. During the final weeks of the project, we found ourselves with two components that are not obviously compatible. On the one hand, there’s the path-finding algorithm that runs on Open Street Map graphs; on the other, there’s the rasterized heatmap whose values are encoded on individual pixels. One deals with vectors and vectorized shapes that are meant to represent real-world objects regardless of scale, and the other deals with numeric values that are scale-dependent.
If you’re familiar with Graphic Design, imagine transferring selective pixel values from Photoshop outputs to a Illustrator output while maintaining the integrity of the vector file.
After many trials and errors, the team came up with a way to map both outputs onto a shared space, in the form of an algebraic matrix. Interpolations were made between vector coordinates to simulate the presence of a vector line while a Moving Average filter runs along said line to collect the values of nearby pixels. The aggregated value is then mapped to the corresponding street vector in the graph. And voila, we were able to encode the riskiness value from the heatmap to the OSM street graph.
Thanks to the flexibility of Google Colaboratory, we were able to create a demo notebook that allows the user to test out the solution.
The demo is limited to only one district in Istanbul at the moment, namely, district Fatih. Users can test on a single-case basis with one pair of FROM-TO addresses or upload a CSV file, select the FROM column and TO column, and have the algorithm do searches in bulk.
Check out this colab notebook.
In this project, we looked into reducing the risk of traveling after the event of an earthquake using suitable machine learning approaches. In the urban environment of Istanbul, we made the assumption that safety correlates with areas with low building density and safety correlates with wider roads and streets.
Using state-of-the-art image machine learning models, we were able to represent said assumptions in the forms of rasterized heatmaps. We were also able to integrate the heatmaps with existing street graphs made available by the Open Street Map project. The final result allows the user to find the safest path from one place to another that favors going through open areas on wide streets and roads.
More importantly, all of this work was done by a team of volunteer collaborators across the world. Yet in a span of two months, we’ve explored the boundaries of the solution space, navigated through the limitations in data availability and technical complexity, and arrived at a functional solution.
I am very proud of having been a part of this challenge and, personally, thoroughly convinced that collaboration done right can bring about amazing results.
Thank you, Omdena, for this opportunity to learn and make a real impact on the world!