My city was always a great city to live in (Vinhedo located in the state of Sao Paulo), but it eventually got taken over by political war. The town dwindled in chaos as political parties split ways to run for mayor. My heart has always been with the well-being of the city and its citizens. I never cared to worship a man or woman running the election.

The most crucial factor is the candidate’s intention. You only find out their real intent once they assume the position. I have watched a digital war go on about city problems and an outcry for a solution.

Thus I conceived my App (Cidade Digital). An easy way for anyone to open up a civil request/complaint with the right department right from their app. Let’s see what happens from the minute someone opens up a new request:

1. User opens a new city request/complaint. The users can choose from a pre-built list with topics or a generic one. Example: Pothole, Dirty Streets, Vector Management for Aedes Aegypti (Mosquito that transmits the dengue fever), Dirty Streets, Trash, etc.

2. A trained Machine Learning server (named Alfred) receives the complaint and verifies image contents. If it matches what they say they’re sending, (if it’s a pothole, it should match a pothole, if it’s a light pole, it should match a light pole).

This is the output detection after an image goes through Alfred, our Machine Learning Server

3. The complaint information gets sent out to the appropriate department directly into the city hall and posted on Facebook, where citizens can interact.

The App helps cut costs for the city when dealing with issues such as Aedes Aegypti. The Town Hall receives precise information about possible vector locations. This information helps reduce the cost of labor of having people scour the city to deal with vector management on Aedes Aegypti. By having proper vector management the App, therefore, help save lives and prevent diseases, such as Dengue Fever, Chikungunya and Zika Virus.

Another significant factor is speeding up civil services when an issue pops up, such as patching a pothole. The usage of the App will increase happiness with public services – according to a survey we ran on people that use the App in Vinhedo. The result, 659 out of 838 people who answered the survey are happy with how fast the civil services acted on their request. Which means 78.63% are pleased with the public services. An expected side-effect is an increase in happiness with the current administration.

The positive economic impact made by the app is overwhelming. Especially considering it was released free of charge to the city or citizens.

Let’s get to know some of the technology behind what makes Cidade Digital work.

The App

Native Android App

The App itself was made using Android Studio. It’s using modern technology and architecture, such as RxJava, Retrofit, etc. It’s a frontend to Alfred.

Alfred – The Machine Learning Server

A cartoon drawing of a biological neuron (left) and its mathematical model (right).

Alfred is using Rectified Linear Unit, which is the most commonly used activation function in deep learning models. The function will return zero if it receives any negative input, but for any positive value \(x\) it returns that value back. So it can be written as:

\(f(x) = max(0,x)\)

And it looks like this as a graph:

Some of the libraries used for this project included TensorFlow, Keras, OpenCV, Yolo-v2, among others.

Facebook post automation was done using the library Selenium.

Next time we’ll get more in depth about how I’m using those libraries.