An unsolicited idea to help improve the odds of catching the SpaceX rocket fairing

I absolutely love innovation … so when I read in the news today about how hard it is to catch the SpaceX rocket fairing with a net that is installed above a moving ship, and seeing that the failure to catch that nose-cone has happened before, I asked myself … what crazy (but theoretically feasible) solution could be explored in that scenario that no one has talked about yet.

TLDR: Here’s my unsolicited idea:  A custom-built drone that can nudge the fairing in the right direction. It might be a creative and economical solution for the problem.

Continue reading

How to cultivate best-in-class Machine Learning models.

Here’s the problem I want to address:

It’s not trivial to compare a very diverse set of Machine Learning models and identify where each model stands out and/or where it can be improved.

Artificial Intelligence (AI), Machine Learning (ML) and Deep Learning (DL) are the focal point of a vast amount of articles and books being written by researchers and practitioners.  In many instances, a common denominator is the claim that great AI algorithms are expected to be fast, accurate, and deliver novel insights.  And adding to that list, if working with those algorithms wasn’t hard enough already, a more recent trend also expects those well-tuned models to also get ethics and transparency. 

Data science teams certainly face a lot of pressure these days.  Can they succeed?

Sure they can!  It’s already a common practice to use a range of methods to evaluate a model’s performance. Some approaches include working with a confusion matrix and its many rate values (e.g. accuracy, precision, recall, sensitivity, specificity, F1-score), or using feature engineering, selection, and cross-validation to tune up classification/prediction models.

But to everyone’s despair, the number of variables and scenarios to analyze can very quickly escalate and spiral out of control … so what can help data scientists evaluate the best mix of input features, training processes, and model hyperparameters to create and deliver best-in-class model outputs?

I want to propose the following mix: Automation + Artificial Intelligence + Benchmarking

In this article I’m proposing a new strategy for teams that have to manage a complex suite of ML models as part of their data science initiatives. I hope to shed some light on the subject of model selection and optimization through the use of insights discovered using comparative performance analysis, sometimes referred simply as ‘benchmarking’.

Continue reading

Creating a real-time cross-language communicator

Here’s my latest fun project.  An iPhone app that performs real-time translation while leveraging Speech-to-Text and Text-to-Speech technologies.  For example, the app will listen to someone speaking Portuguese, will translate it to English, and speak the translation in English.  The app will also do the other way around. It will speak in Portuguese words pronounced in English.

The app is currently configured to help Portuguese and English speakers.  It helps them communicate with each other.  The idea is to have the iPhone sit between them… listening to them, translating in real-time all spoken/typed words, and speaking the translated words in the target language.

Currently, this is not a commercial/published app.   And although there might be similar apps already out there – I didn’t find anything exactly like this… I primarily created it so my son (who barely speaks Portuguese) can have a custom tool to help him communicate with many of his relatives (who barely speak English).  Let’s see how it plays out… 🙂

as sete cidades do arco irisMy inspiration for this project dates back to the early 80s, when my second grade teacher assigned a book for all students to read: “As sete cidades do arco-iris” (translation: the seven cities of the rainbow), a book by Brazilian author Teresa Noronha.  The storyline was about a kid taken to a different planet where people from the different cities spoke different languages. On his way to the cities the main character was given a device to carry around his neck that would translate everyone to him in real-time, and vice-versa, also translating his words to everyone.  Sadly, I no longer have that book.  But the concept for that real-time translation/communication device stuck with me and I finally have the tools to create something like that.

My App is written in Swift – Apple’s scripting language.  For the Translation and Speech-to-Text components I’m using Google’s APIs.  For the Text-to-Speech, I’m using Swift/iOS’s own Speech framework, which is available for free, unlike the Google API, which has a tiny, tiny cost.  But I might switch to Google’s Text-to-Speech API to try to implement a feature I outline 3 paragraphs below.

It amazes me how accurate Speech Recognition has become.  Not long ago, around 2010, while working for another company, I worked on a very comprehensive research to identify a good Speech Recognition framework and after evaluating the top free/commercial options available at that time, on average, things would only be correct about 60% of the time, at best.  It used to be that the only way to ensure good recognition rates was to define a controlled dictionary ahead of time to limit the search space.  Today, there’s no need to use controlled dictionaries.  It’s amazing how the quality of the task has improved with companies like Apple, Google, and Amazon now using (Deep) Neural Nets and complex models to train their services.

As for my prototype app, my next step is to come up with a way to detect the spoken language automatically.  Google used to have an API for language detection, but it doesn’t seem to be available anymore (?!)  Getting language detection in place will allow the device (i.e. the phone) to simply sit in front of the people having a conversation, without a need to press a button telling the app what language to hear.

The other feature I want to implement is allowing the Portuguese voice to come out of one audio channel (e.g. left) while the English voice comes out of the other channel (e.g. right).  That way, both people could use the same pair of earbuds to listen to each other, without the iPhone’s speaker be repeating everything for everyone around to hear.  But the Apple framework I’m currently using for the Text-to-Speech doesn’t seem to support that channel toggling so that feature will have to wait for some further research.

In any case, the current prototype seems to be working pretty well, and I’m looking forward to see people testing it out!   🙂

Posted by André Lessa

Blueberries, Gelatin, and Gravity.

Back in school, most of us have learned that Earth’s gravity is a force that pulls objects. But what if gravity is actually a force pushing the space fabric towards Earth’s center of mass?


While staring at a fresh bowl of gelatin, which I filled with a handful of blueberries, I couldn’t help but wonder how the little blue fruits did resemble planets floating around in the cosmos. But since the blueberries were not really floating – they were suspended and fully engulfed by the gelatin – I had to ask myself:

“What if space is really like a really big chunk of gelatin, engulfing planets and every other body of mass in the universe?”

I grew up reading books that explained how Gravity is a force that pulls things, people, air, toward the center of the Earth.  I now question that notion.  As I describe here, my new interpretation is that what we call Gravity is actually a compression force generated by the space fabric that surrounds us… pushing things, compressing them, keeping them relatively in place.  Maybe others have already documented these hypotheses, but since I’m realizing them now for the first time, I thought I’d write this post to document my thoughts, just in case.

This line of thinking might sound completely crazy, absurd, and preposterous but do hear me out as I go out on a limb here.

It is common knowledge that there are 4 fundamental forces of nature: Strong force, Weak force, Electromagnetism, and Gravity. However, little is know about Gravity.  In my opinion,  if space were to behave like gelatin, it would explain Gravity.

First, an observation:

Have you noticed that most large bodies of mass in space are spheres? Leave large rock fragments in space and after 1000s of years, they start to bundle together and form a sphere. So why would that happen? Some force would have to be pushing those objects towards their combined center of mass. Compressing an object with the same amount of force, from all sides, generates spherical shapes over time.  Maybe that’s exactly what the space fabric is doing.

Here’s my hypothesis #1: What if Gravity is what happens when the space fabric compresses bodies of mass, pushing them towards their own center of mass?

Gravity is a weak force, but the bigger the object, the more affected by Gravity that object becomes. That’s because the bigger the object, the more space is pushed aside and compressed to make room for the foreign object to fit in.

Let’s visualize what I call space compression and expansion. Let’s talk about tides. We all know that the Moon proximity to the Earth affects the tides so it shouldn’t be no surprise to know that when the Moon is really close to the Earth, we get the high tides. By getting closer to the Earth, the Moon is really shielding Earth from a lot of the compression effects of the larger space fabric, which reduces the amount of force that pushes the water towards the center of the Earth. As a consequence, we have the high tides because theoretically there is less space compression forces acting on that water (and not more Moon gravitational forces, as popular science claims).  Eventually, when the Moon moves away from that side of the Earth, the space fabric compresses the Earth with stronger force, pushing the water towards the center of the Earth, and back to its standard levels.


The Gelatin bowl analogy also helps with another point: space, just like the gelatin, pushes objects towards each other.  You’ll see that, over time, some blueberries get pulled towards others. Why does that happen? That’s because the gelatin space gets warped by the presence of certain blueberries, which create areas that are more or less dense.  Therefore, allowing some of the other blueberries to be attracted to the less-dense gelatin areas as there is less friction to get there.

Here’s my hypothesis #2: What if Orbits are what happens when expansion/contraction events force an object to move?

I think objects spin around stars just like the wind in hurricanes.  What if the universe is expanding in one direction, but is actually contracting in another direction? That would act similarly to the high/low pressure effect we observe in hurricanes. What if there are areas sandwiched in space where one side has high pressure, and the opposite side has low pressure. Everything in the center would spin, just like a hurricane.

Usually, the eye of a traditional hurricane is an area of tranquility, but in space, all those spinning objects eventually converge towards a central point,  which always seem to be located at the center of a galaxy. All that mass converges to what we call a Black role. So, it looks like a black role is essentially the eye of a galactic hurricane.

So the combination of both the expansion and the contraction of the universe seem to force Galaxies to spin, all while the space fabric is compressing the galaxies toward their own centers of mass, which ends up forming black roles.

Here’s my hypothesis #3: What if space is a malleable fabric similar to our Gelatin analogy, and it can also be compressed?

If you press a blueberry onto the gelatin, deforming its surface, you’ll find out that all the gelatin is still there, but it’s compressed now. The gelatin is trying to compress the blueberry but it doesn’t destroy it because, like Gravity,  that compression force is a very weak force. Same happens if you were to put an orange in the gelatin. However, since a bigger chunk of space is being compressed to give room to the Orange, the force on the Orange’s surface feels slightly stronger – if you were to stand on the surface of that Orange. That would explain things like why gravity on the Moon is lighter than the gravity here on Earth. It’s all about how much space is being compressed to make room for a body of mass. The more compressed is the space fabric around an object, the strong the gravity force becomes.


If we go back to fundamentals of physics, we learned that time equals distance divided by velocity. Given a constant velocity, the more space (i.e. distance) is compressed, the slower time will be perceived. In other words, the stronger the effects of a Gravity force is, the longer time dilation turns out to be, causing one’s perception of time to seem that clocks are running slower.

Picture an accordion.  It doesn’t matter whether it is open or closed, its fabric is still the same; The accordion never changes, but its real length/distance does. When the accordion is compressed, air travels faster from one end to the other. Likewise, if the space fabric is compressed, the fabric is still the same, but its length is reduced, causing time to travel faster.

That goes hand in hand with the famous twin astronauts experiment and I will add to that idea.  In my line of thinking, as the astronaut distances herself/himself from disturbances on the space fabric, the effects of time dilation becomes less easily perceived.  The exception would be if changes to velocity were involved. In that case, the faster the astronaut moves, the more likely he/she would be to be affected by the effects of time dilation.

That creates many implications. First, if the space fabric is densely compressed near very large bodies of mass, it would make sense to travel through that path in order to get to a destination faster, although more energy would need to be used to prevent the space fabric from pushing the spaceship towards the larger body of mass and essentially capture it.

Here’s my hypothesis #4: What if space can be compressed and bent, forming pathways that act as shortcuts?

Maybe the shortest distance between 2 points is not a straight line.

Imagine what would happen if the space fabric could be simultaneously compressed in multiple points, causing the compressed fabric to start looking like a folded sheet of paper, a skate ramp, or a u-shaped tube.   You’ve probably seen this example before.  What if those ends were to meet?  Traveling through that compressed space would get you to your destination faster than if you were traveling through the same space (following its surface) without being affected by any forces.

And a final theory to wrap up this post. Here’s my hypothesis #5: What if spaceships could travel faster by knowing where compressed spaces are located?

It’s unlikely that any spaceship would have enough energy to disrupt the space fabric by itself. However, if this hypothesis is true, the universe is probably full of compressed areas of space fabric, and the knowledge of where those disruptions naturally occur could enable a navigator to plot a travel course that would benefit from as much compressed space as possible, allowing spaceships to travel great distances in short amounts of time. Maybe such space fabric disturbances are the pathways of the universe.


Unfortunately, I cannot guarantee that any of my hypotheses are absolutely true and correct, but I do hope you find them amusing, creative, and inspiring. And if you happen to know a theoretical physicist, or two, please do share this post with them for their thoughts.

~ André Lessa

Working with your Twitter Followers/Following lists

This post is about how to get a simple list of Twitter Followers/Following that you can work with, using the data that’s already available for you – on your own browser.  It’s a concept similar to how bookmarklets work, but this approach doesn’t involve installing anything on your machine.

This quick solution runs on your own Chrome browser,  requires no API dev work, requires nothing to be installed, requires no additional page requests, and requires no 3rd-party services. It’s very simple, you control it, and it uses your browser’s own inspection tools. It’s just Javascript using XPath to navigate the page’s DOM.

  1. Use Chrome (it might work with other browsers, but haven’t checked);
  2. Go to the followers/following section and scroll all the way to the bottom so they’re all visible on the page;
  3. Right click the web page and choose “Inspect”;Screen Shot 2016-08-12 at 12.45.18 PM
  4. You’ll see something like what I’m showing here. Click on Console; Screen Shot 2016-08-12 at 12.37.20 PM
  5. Paste the following Javascript code on the prompt and press Return/Enter. Note that it’s one very long line;

a=$x("//div[@class='ProfileCard-userFields']");b=[];for(var i=0;i<a.length;i++){b.push("@"+$x(".//span[@class='u-linkComplex-target']/text()",a[i])[0].textContent+"\t"+$x(".//a[contains(@class,'ProfileNameTruncated-link')]/text()",a[i])[0].textContent.replace(/(^\s+|\s+$)/g,''));b.join("\n")}

As a result, you get a newline-separated list of handles and names that can be easily copied, and then pasted into a text editor or spreadsheet. Handles and names are separated with tabs so you can easily separate the data into columns for filtering and/or sorting.

This seems to work fine today… but if the design of the page loaded by your browser changes, this will likely stop working.


Hacking an electronic face for my Amazon Echo.

Like everyone’s Amazon Echo, mine would simply blink an array of lights every time it would utter words in response to my requests. So I had a simple idea. Wouldn’t it be fun to actually add a face to it, one that would come alive whenever the device spoke?

Screen Shot 2016-06-19 at 10.13.38 PM

So I built one just for the fun of it.  The face is actually a TFT display and the brain is an Arduino controller connected to a few supporting electronics and sensors – all powered by some clever Arduino programming.  It all comes to life every time Alexa talks. When Alexa is done talking, the face goes back to sleep.   The face has eyes and a mouth. The eyes circle around while awake, and the mouth moves according to the rhythm of Alexa’s speech, which is coming out of the Echo device, as if the face was actually uttering the words – a real-time effect I came up with, which also senses whether Alexa is the one doing the talk so it’s not triggered by me or anyone else who happens to be talking nearby.

And no, I didn’t have to hack my way into  the actual Amazon Echo circuits. I’m also not using any Amazon APIs. In fact, the solution lies in simple physics and some basic electronic and software skills.  My project just sits on top of the actual Echo device without interfering with its functionality and without voiding its warranty.

In an upcoming post I will publish the schematics and a documented version of the source code, describing how anyone can build one just like the one I came up with.

If you want to check out a live video showing my little Arduino-based hack project, it’s on youtube.

~ André

Not all ideas are worth of your time – assess them all, wisely.

What’s the risk of setting your imagination free in the wild?  Is that new product idea worth of your time?  Say you have an idea for a product or product feature. Should you go for it?

That’s a question I’m constantly faced with, and truth be told, I haven’t completely mastered it yet – although my decision process has evolved over the years. Because I always write down every single new idea I have, and I can’t pursue them all, I’m always asking myself: “how to decide what idea should be at the top of my list?”

the risk of pursuing a product idea

The risk of pursuing a product idea.

These days, I believe that to be successful in deciding what ideas are worth pursuing, one’s state of mind has to be around how to mitigate all the risk associated with the pursuing of such creative bolts. Yes, sometimes not pursuing one idea, is the best idea; Not all of your ideas are worth of your time; And many times, the best ideas turn out to be the result of many doomed ideas.

Here’s a summary of lessons I learned over the years in the form of questions I regularly ask myself. So, when facing a new idea, if you want to try my process, ask yourself this type of questions, which I see being grouped in 3 major risk-assessment categories.

1. The perceived value of the idea:

  • Is this something you believe in?
  • Is this something that people might like?
  • Is this something that people might want to have?
  • Is this something that people might pay for?
  • Is this something that can be used to attract/get customers?
  • Is this something that creates a significant piece of intellectual property?
  • Is this something unique that no one else has done before?
  • Is this something you talked to others about, and the feedback was mostly positive?
  • Is this something you could see yourself using/buying?
  • Is this something that if it wasn’t yours, you’d love to read all about it in a magazine?
  • Is this something for which you already have all the required buy-in?
  • Is this something that someone else is paying you to create?
  • Is this something that will help you accomplish a long term goal?

2. The ability to execute the idea:

  • Is this something you have full and complete understanding of?
  • Is this something you can (financially) afford creating?
  • Is this something you can count on everyone else who need to be involved?
  • Is this something unlikely to break other parts of an existing system?
  • Is this something you can quickly prototype to confirm that it can work as desired?
  • Is this something you have all the tools/dependencies needed to build it?
  • Is this something similar to another idea you successfully delivered before?
  • Is this something you can learn more about if you feel you don’t know enough yet?

3. The amount of time the idea will require:

  • Is this something you can fit in your work schedule?
  • Is this something you can fit around your personal schedule?
  • Is this something that won’t affect your dedication to other professional responsibilities?
  • Is this something that won’t affect your dedication to other personal responsibilities?
  • Is this something you can delegate to another team member, if needed?
  • Is this something whose total project length you can guesstimate early on?
  • Is this something you can see yourself maintaining in the long run?
  • Is this something that won’t seriously damage the progress of other concurrent ideas?
  • Is this something that if put aside for some time, will still be relevant when you get back to it?
  • Is this something whose first version/prototype can be done in a reasonable amount of time?

Of course, the list above is a living organism. It’s always evolving – even during the course of this writing.

Depending on the situation, not all questions are applicable, and different questions might have different weights. In my analyses, I usually put a lot of weight on the time factor because I think time is the most precious non-renewable resource we have, it’s the one reason I never wear a watch as I don’t want to be continuously reminded that time is constantly passing us by. To help manage the time factor risk, when jumping on a new idea, sometimes I give myself an “exploratory” timeframe or an actual deadline to wrap it up (for this post, for example, I gave myself tonight and tonight only). If at the end of that given period, the idea hasn’t developed well enough for my taste, I simply put it back in the idea bucket. You never toss an idea completely away because you never know when your next idea will come by and (just maybe) present itself as a great companion to those rejected ideas that have been long forgotten inside that creativity container of yours.

Very recently, I watched an interview with author and illustrator of children’s books, Mo Willems, and he said: “[…] a mistake that people make is they think ideas are things that you get, like shoes. And they’re not. They’re not shoes. They’re plants. Ideas are things that you grow, and every day you go back, and you take your sketch book, and you’re planting a little seed, and some of them just don’t grow at all. And every now and then, one of those seeds slowly, slowly grows up and becomes a beautiful tree that bares fruit that you can cut down and burn for profit. […]”

Imagination is not something tangible, and the risk of pursuing ideas cannot be easily quantified so I acknowledge that my informal process might have its flaws.  However, if while analyzing an idea, you end up answering “No” too many times to applicable questions like the ones I listed in this post, it’s likely that you have to proceed with some considerable amount of caution, if at all. Nonetheless, simply by going through such checklist in your head, you might be able to quickly figure out whether an idea is a yay or a nay. And if you happen to have many ideas concurrently circling around in your head, this little exercise might offer you a very naive – but efficient – framework to rank them all, while helping you figure out where your attention should go next.

Imagination’s greatest threat is the absence of an inspired and organized mind.

~ André Lessa

An idea to improve the success rate of reusable space rockets’ vertical landings.

For the past year or so, while seeing all the news coverage related to commercial companies going after the much sought-after recycling of space rockets, I asked myself, what could be done in a relatively short amount of time to improve the reliability of this fairly new vertical landing strategy? What could allow rocket companies to save tens of millions of dollars instead of facing failed landing attempts? So I started thinking about ideas that could improve success perception, and allow rocket companies to try to rescue rockets that misbehave during the last few seconds of their vertical landings. As a result of all this unsolicited thinking, I came up with an idea, which might not be 100% feasible, but hey, creativity and the will to innovate are everything!

The current state of things:

Bringing any rocket to a perfect precision vertical landing is a (huge) challenge. Rocket engineers have already created rockets that have an elaborated landing system that includes  capabilities like timed burns for deceleration, independent grid fins, and deployable landing legs, all to provide additional aerodynamic stability that is capable of supporting the forces of landing and the mass of nearly empty rocket stages.

As a naive outsider watching the landings, what I noticed is that during most unsuccessful landings, the overall operation seems to fail usually right after rockets reach the targeted landing area, as they reduce the engine thrust for the touch down.  A common problem I observed while watching the available failed landing videos was that as certain rockets started tilting during the last few seconds of landing, their center of mass get affected and reach a point where nothing else can be done to help balance them. In those cases, given a rocket’s lack of powerful thrusters (above their center of gravity) to quickly counter balance any excessive uncontrolled tilting, things will inevitably start to literally go sideways.  A good analogy uses a broomstick as a reference. Try to balance a broomstick using the palm of your hand, and move your hand to the ground level until your hand movements come to a full stop, all while keeping the broomstick upright.  The broomstick task would certainly become less difficult if one could use their other hand to briefly nudge the top of the broomstick, here and there, as needed, gently helping balance the broomstick, bringing it to a restful state.

The Idea:

I’m not going to talk about tweaking the rockets.  Companies in that industry already have 1000s of rocket scientists working on that front. What I’d like to propose is focusing on a landing assistance apparatus that could be quickly activated and deployed at the planned landing site. Essentially, a plan B. Here’s the thing: Any reusable rocket with their broomstick-like rocket design could, at least in theory, have a fallback plan relying on that same broomstick-nudging strategy to help stabilize the rocket’s landing angle and bring it to a steady vertical alignment.

How would this work?

At its core, the idea is to create an autonomous system and apparatus capable of :

  • Identify that the rocket is close enough to the landing target area but it’s getting out of control by losing its vertical alignment, and could require some landing assistance;
  • Have a mechanical “hand” capable of freely and quickly moving around the landing area, and position itself where it can lightly touch the rocket, providing just enough supporting surface above the rocket’s center of mass to allow the rocket to pivot and realign itself for the landing;
  • Once the vertical alignment is reached, the machine would either get out of the rocket’s way, or if needed, continue to assist the rocket until the landing is complete;

To quickly position itself at the right place, a guiding track would be constructed in the perimeter of the rocket’s landing area (Fig.1), where a fast automated transportation system (Fig.2) carrying a large hydraulic/pneumatic gripper (Fig.3) would quickly position itself to lightly touch the rocket just above its center of mass (Fig.4). 


Such fast and automated guiding track could, in theory, be mounted underground to minimize the footprint of the apparatus and any applicable air-drag resistance. The time between detecting a problem and start delivering the assistance is in the order of seconds. Apparently, based on observations, 5-10 seconds at the most, so I believe that the custom vehicle operating on such track would require both a body with a low drag coefficient rate and high-torque engines working in parallel, something with a powerful acceleration to be able to quickly position the apparatus at the right location around the rocket. The large hydraulic/pneumatic gripper would also require a special setup to allow the rocket to touch it while generating the least amount of friction/heat as possible. A possible solution would be to equip the gripper with powerful magnets that would react to a magnetized rocket surface with opposite forces, but that would require changing the design of the rocket, so maybe a simpler solution is to equip the gripper hand with several wheel-like points that would gently spin as the rocket slide its way down the grip. It’s important to highlight that there’s no grabbing of rockets here. The goal is to simply provide a surface that can be used to lightly nudge the top of the rocket, just like it can be done with a broomstick.

Back to the design aspects, low footprint of the overall apparatus is a key requirement as this system cannot have a tall structure as those can prevent rockets from reaching their target landing areas.  Another design consideration is that since the gripper would neither need to support the full weight of the rocket,  nor have a need to grip its whole circumference, this apparatus wouldn’t necessarily need to be a very rugged system. It would only need to be nimble enough to quickly position itself and provide a supporting surface for the landing rocket to touch and start a pivoting operation, auto-correcting its landing angle, and eventually, vertically realigning itself.

In closing…

I’m a computer scientist and a thinker, not a rocket scientist, not a mechanical engineer. I do enjoy trying to solve hard challenges that I find intriguing though. I’m a big fan of innovation and I think that what I have described above is a very cool and innovative solution to increase the success rate in the process of landing reusable rockets.

If not completely practical, I hope this idea is at least inspiring to the scientists and engineers out there in such exciting industry.

~ André Lessa