The use of AI in policing to date has largely been in areas such as facial recognition and helping to deploy resources in the most effective ways, but a recent study led by Northumbria University highlights how it can also help to crack unsolved crimes, especially by providing insights into the weapons used in committing the crime.
“Machine learning uses a series of algorithms to model complex data relationships,” the authors say. “Through careful fine-tuning, these can be applied to predict important characteristics of the ammunition used in a particular shooting event from those of the respective gunshot residue (GSR) deposited on surrounding surfaces or items, such as spent cases, wounds, and, potentially, also the shooter’s hands.”
Now, back to what I was going to write about. If you ask me, I’ll already admit that I have NOT even scraped the surface of these topics. What I share here is a glimpse of what’s out there and each one of you might have discovered many more aspects of these topics as part of your daily professional and personal pursuits.
One of my motivations of putting this post and the links below together comes from the discussion we had during the LJC Unconference in November 2018, where Jeremie, Michael Bateman, and I, along with a number of LJC JUG members, gathered at a session discussing a similar topic. And, the questions raised by some were along the lines of "where does Java stand in the world of AI-ML-DL?," "how do I do any of these things in Java?, and "which libraries and frameworks should I use?"
SAE Institute from Australia is considered the front-runner in creative studies. They recently ran a survey to understand the general sentiment of students and identify key areas of improvement. This case study describes how ParallelDots carried out a detailed survey analysis to make sense of the student responses and derived specific insights from this data. 750 students responded to the survey, resulting in a total of 4500 comments.
The Challenges in Traditional Survey Analysis
Traditional methods of survey analysis suffer from multiple human biases and are intensive in terms of effort as well as time. Knowing this, the institute decided to outsource the project to ParallelDots.
Powerful Image Analysis With Google Cloud Vision And Python
Powerful Image Analysis With Google Cloud Vision And Python
Bartosz Biskupski
Quite recently, I’ve built a web app to manage user’s personal expenses. Its main features are to scan shopping receipts and extract data for further processing. Google Vision API turned out to be a great tool to get a text from a photo. In this article, I will guide you through the development process with Python in a sample project.
If you’re a novice, don’t worry. You will only need a very basic knowledge of this programming language — with no other skills required.
Let’s get started, shall we?
Never Heard Of Google Cloud Vision?
It’s an API that allows developers to analyze the content of an image through extracted data. For this purpose, Google utilizes machine learning models trained on a large dataset of images. All of that is available with a single API request. The engine behind the API classifies images, detects objects, people’s faces, and recognizes printed words within images.
To give you an example, let’s bring up the well-liked Giphy. They’ve adopted the API to extract caption data from GIFs, what resulted in significant improvement in user experience. Another example is realtor.com, which uses the Vision API’s OCR to extract text from images of For Sale signs taken on a mobile app to provide more details on the property.
Machine Learning At A Glance
Let’s start with answering the question many of you have probably heard before — what is the Machine Learning?
The broad idea is to develop a programmable model that finds patterns in the data its given. The higher quality data you deliver and the better the design of the model you use, the smarter outcome will be produced. With ‘friendly machine learning’ (as Google calls their Machine Learning through API services), you can easily incorporate a chunk of Artificial Intelligence into your applications.
Let’s start with the registration to Google Cloud. Google requires authentication, but it’s simple and painless — you’ll only need to store a JSON file that’s including API key, which you can get directly from the Google Cloud Platform.
Download the file and add it’s path to environment variables:
Alternatively, in development, you can support yourself with the from_serivce_account_json() method, which I’ll describe further in this article. To learn more about authentication, check out Cloud’s official documentation.
Google provides a Python package to deal with the API. Let’s add the latest version of google-cloud-vision==0.33 to your app. Time to code!
How To Combine Google Cloud Vision With Python
Firstly, let’s import classes from the library.
from google.cloud import vision
from google.cloud.vision import types
When that’s taken care of, now you’ll need an instance of a client. To do so, you’re going to use a text recognition feature.
client = vision.ImageAnnotatorClient()
If you won’t store your credentials in environment variables, at this stage you can add it directly to the client.
The response consists of detected words stored as description keys, their location on the image, and a language prediction. For example, let’s take a closer look at the first word:
As you can see, to filter text only, you need to get a description “on all the elements”. Luckily, with help comes Python’s powerful list comprehension.
If you look carefully, you can notice that the first element of the list contains all text detected in the image stored as a string, while the others are separated words. Let’s print it out.
print(texts[0])
SHOPPING STORE
REG 12-21
03:22 PM
CLERK 2
618
1 MISC
1 STUFF
$0.49
$7.99
$8.48
$0.74
SUBTOTAL
TAX
TOTAL
CASH
6
$9. 22
$10.00
CHANGE
$0.78
NO REFUNDS
NO EXCHANGES
NO RETURNS
Pretty accurate, right? And obviously quite useful, so let’s play more.
What Can You Get From Google Cloud Vision?
As I’ve mentioned above, Google Cloud Vision it’s not only about recognizing text, but also it lets you discover faces, landmarks, image properties, and web connections. With that in mind, let’s find out what it can tell you about web associations of the image.
web_response = client.web_detection(image=image)
Okay Google, do you actually know what is shown on the image you received?
Good job, Google! It’s a receipt indeed. But let’s give you a bit more exercise — can you see anything else? How about more predictions expressed in percentage?
Surprisingly, with a simple command, you can check the likeliness of some basic emotions as well as headwear or photo properties.
When it comes to the detection of faces, I need to direct your attention to some of the potential issues you may encounter. You need to remember that you’re handing a photo over to a machine and although Google’s API utilizes models trained on huge datasets, it’s possible that it will return some unexpected and misleading results. Online you can find photos showing how easily artificial intelligence can be tricked when it comes to image analysis. Some of them can be found funny, but there is a fine line between innocent and offensive mistakes, especially when a mistake concerns a human face.
With no doubt, Google Cloud Vision is a robust tool. Moreover, it’s fun to work with. API’s REST architecture and the widely available Python package make it even more accessible for everyone, regardless of how advanced you are in Python development. Just imagine how significantly you can improve your app by utilizing its capabilities!
How Can You Broaden Your Knowledge On Google Cloud Vision
The scope of possibilities to apply Google Cloud Vision service is practically endless. With Python Library available, you can utilize it in any project based on the language, whether it’s a web application or a scientific project. It can certainly help you bring out deeper interest in Machine Learning technologies.
Google documentation provides some great ideas on how to apply the Vision API features in practice as well as gives you the possibility to learn more about the Machine Learning. I especially recommend to check out the guide on how to build an advanced image search app.
One could say that what you’ve seen in this article is like magic. After all, who would’ve thought that a simple and easily accessible API is backed by such a powerful, scientific tool? All that’s left to do is write a few lines of code, unwind your imagination, and experience the boundless potential of image analysis.
monday.com is a project management tool teams love! It’s super flexible and easy for everyone to collaborate! Plan visually and see who’s doing what at a glance.
A marvelous Google experiment where you can control an orchestra with your body movements. Built by Rupert Parry, Melissa Lu, Haylie Craig and Samantha Cordingley. Watch the video and find out more on this page.
Optician Sans is a free font that is based on the same visual principles as the LogMAR chart, adjusted to be used as a fully functional display typeface. It was created by ANTI Hamar and typographer Fábio Duarte Martins.
A tutorial by Per Harald Borgen where he shows how to create and train a neural network using Synaptic.js, which allows you to do deep learning in Node.js and the browser.
Samer Buna’s practical introduction to the fundamentals of React.js for those who are already familiar with JavaScript and know the basics of the DOM API.
Puppeteer is a Node library which provides a high-level API to control headless Chrome over the DevTools Protocol. It can also be configured to use full (non-headless) Chrome.
Alla Kholmatova writes about the challenges of creating a cohesive system and ensuring consistency when it comes to integrating animations into a design.