Pular para o conteúdo principal

Postagens

Getting Started with Red Hat Decision Manager

Red Hat released Red Hat Decision Manager and we already have a few resources for those who want to quickly get starting with RHDM.  For those who are not familiar, RHDM is based on the community project called Drools , so what you see here will probably work with Drools 7 as well. Here's our mandatory hello world application from rule authoring to deployment: More applications like this can be found in my github . Of course, there is always the great RHDM documentation .

Detecting objects using JavaFX and Deep Learning

Computer vision meets Deep Learning mainly due the use of Convolutional Neural Networks . We have used it in our blog already for labeling images. Another challenging area of Deep Learning and computer vision is to identify the position of objects and for this we have a great neural network technique (or architecture - you choose the best) called YOLO . The following video will show you the power of YOLO neural networks: The output of a neural network such as Resnet50 is a vector with probabilities of labels. So you feed it with an image that contains a cat, it will output various float numbers in an array, each position of that array is a label and the value on that position is the possibility of that label. As an example let's think about a neural network that should recognize dogs (0) and cats (1), and you feed it with an image of a cat, it should output an array of two positions and 0% in position 0 (which represents dog) and 100% in position 1 (which represents cat). Th...

MicroProfile Config from a JavaFX application

Most of you probably heard about Eclipse Microprofile , including Microprofile Config. A quick try from a desktop application that uses JavaFX shows that it works without any additional configuration: just add a implementation dependency to your classpath and you can use microprofile config. See below a simple example. This results in: Conclusion Microprofile config works with JavaFX and this is great news. Microprofile is evolving quickly and JavaFX being able to work with it will give Java developers the ability to easily integrate desktop applications with java microservices.

Visualize a neural network activation using JavaFX

Sometimes you want to visualize what is going on inside your neural network to identify what you could improve. This is not an easy task and may require patience. To help on this task I am sharing today a small JavaFX application that will go through all the activated layers and show the activated output and the ones that were not updated. The results are interesting, see some screenshots I took using the Brazilian coin model , which was trained on a deep pre-trained Resnet50 neural network: At the early layers we can see some sort of the shadow of the coin In the middle we can see some features that were activated Close to the end only some outputs were activated It is confusing when we check these huge third party neural networks. It is more interesting when we inspect some neural network we created ourselves. Remember when we used a trained MNIST model in a JavaFX application ? These are the layers after an image classification: This was possible using the ac...

Generic Telegram bot for image classification using DL4J

This might be useful for someone else. Using the TelegramBots Java API I build a generic bot which you can use for any ComputationGraph you exported from a DeepLearning4J application. The bot simple gets any image it receives and use the model to predict an output. All you have to do is ask for a BotFather  key and set a few system properties: bot.username : Your bot userame bot.token : The bot token you got from  BotFather classifier.labels : The model labels separated by comma classifier.modelpath : The full filesystem path to the model classifier.inputformat : Input image height, width and number of channels separated by comma How it works: First you train your model using DeepLearning4J API and export it . See as example what we did in our Brazilian coin classification post ; Second you get a bot key using  BotFather ; Now you can clone the code from github and build it using mvn clean package (I am considering you already have maven); Finally...

Brazilian Coins Classification Using Deep Learning and Java

It is exciting to learn deep learning. The courses and the results are exciting and you can see it in your machine using popular libraries like Keras for Python and DeepLearning4j for Java. These libraries even have utility methods that will download famous dataset for you, you just have to copy and paste the code and run it, after training (probably a few hours on a CPU) you will have a model that is trained and ready to classify new data. I did that. I did that a lot of times. I also created small neural nets from scratch, but still, I was missing solving a problem with this technology and collect my own dataset. In this post I will share how I used DeepLearning4J to classify brazilian coins. I will try also to share how I failed a lot before getting my current 77% accuracy model. Brazilian coin for one real Collecting the data set We need a large dataset to train a neural network. They say that at least 1k images per classes . I started much less than that, about 50 ima...

Web app to easily collect images for your dataset

It is easy to train your neural network when you get data from the web. Datasets such as ImageNet and Mnist even have utility classes to load the data, such as MnistDataSetIterator from DeepLearning4J. The problem is when you have to collect the dataset yourself. There are many ways to do that, we can try to automatize how we collect the data, but then you may have a dataset that does not reflect the real world. Right now I have to collect images form real world. I can't take pictures from the internet, that are only a few and I can't take in my house or important features won't be learned. So I created a small web application which I think that may be useful for others trying to create their own dataset. The idea is simple: You set the output directory and the possible labels in pom.xml; Then you start the application and start taking pictures with your mobile; The application then saves the images using the label as the parent directory When training yo...