O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Java Deep Learning Projects

Book Description

Build and deploy powerful neural network models using the latest Java deep learning libraries

About This Book
  • Understand DL with Java by implementing real-world projects
  • Master implementations of various ANN models and build your own DL systems
  • Develop applications using NLP, image classification, RL, and GPU processing
Who This Book Is For

If you are a data scientist, machine learning professional, or deep learning practitioner keen to expand your knowledge by delving into the practical aspects of deep learning with Java, then this book is what you need! Get ready to build advanced deep learning models to carry out complex numerical computations. Some basic understanding of machine learning concepts and a working knowledge of Java are required.

What You Will Learn
  • Master deep learning and neural network architectures
  • Build real-life applications covering image classification, object detection, online trading, transfer learning, and multimedia analytics using DL4J and open-source APIs
  • Train ML agents to learn from data using deep reinforcement learning
  • Use factorization machines for advanced movie recommendations
  • Train DL models on distributed GPUs for faster deep learning with Spark and DL4J
  • Ease your learning experience through 69 FAQs
In Detail

Java is one of the most widely used programming languages. With the rise of deep learning, it has become a popular choice of tool among data scientists and machine learning experts.

Java Deep Learning Projects starts with an overview of deep learning concepts and then delves into advanced projects. You will see how to build several projects using different deep neural network architectures such as multilayer perceptrons, Deep Belief Networks, CNN, LSTM, and Factorization Machines.

You will get acquainted with popular deep and machine learning libraries for Java such as Deeplearning4j, Spark ML, and RankSys and you'll be able to use their features to build and deploy projects on distributed computing environments.

You will then explore advanced domains such as transfer learning and deep reinforcement learning using the Java ecosystem, covering various real-world domains such as healthcare, NLP, image classification, and multimedia analytics with an easy-to-follow approach. Expert reviews and tips will follow every project to give you insights and hacks.

By the end of this book, you will have stepped up your expertise when it comes to deep learning in Java, taking it beyond theory and be able to build your own advanced deep learning systems.

Style and approach

A unique, learn-as-you-do approach, as the reader builds on his understanding of deep learning with Java progressively with each project. This book is designed in such a way that implementing each project will empower you with a unique skill set, and enable you to implement the next project more confidently.

Table of Contents

  1. Title Page
  2. Copyright and Credits
    1. Java Deep Learning Projects
  3. Packt Upsell
    1. Why subscribe?
    2. PacktPub.com
  4. Contributors
    1. About the author
    2. About the reviewer
    3. Packt is searching for authors like you
  5. Preface
    1. Who this book is for
    2. What this book covers
    3. To get the most out of this book
      1. Download the example code files
      2. Download the color images
      3. Conventions used
    4. Get in touch
      1. Reviews
  6. Getting Started with Deep Learning
    1. A soft introduction to ML
      1. Working principles of ML algorithms
      2. Supervised learning
      3. Unsupervised learning
      4. Reinforcement learning
      5. Putting ML tasks altogether
    2. Delving into deep learning
      1. How did DL take ML into next level?
    3. Artificial Neural Networks
      1. Biological neurons
      2. A brief history of ANNs
      3. How does an ANN learn?
    4. ANNs and the backpropagation algorithm
      1. Forward and backward passes
      2. Weights and biases
        1. Weight optimization
        2. Activation functions
    5. Neural network architectures
      1. Deep neural networks
        1. Multilayer Perceptron
        2. Deep belief networks
      2. Autoencoders
      3. Convolutional neural networks
      4. Recurrent neural networks 
      5. Emergent architectures
        1. Residual neural networks
        2. Generative adversarial networks
        3. Capsule networks
    6. DL frameworks and cloud platforms
      1. Deep learning frameworks
      2. Cloud-based platforms for DL
    7. Deep learning from a disaster – Titanic survival prediction
      1. Problem description
      2. Configuring the programming environment
      3. Feature engineering and input dataset preparation
      4. Training MLP classifier 
      5. Evaluating the MLP classifier
    8. Frequently asked questions (FAQs)
    9. Summary
    10. Answers to FAQs
  7. Cancer Types Prediction Using Recurrent Type Networks
    1. Deep learning in cancer genomics
    2. Cancer genomics dataset description
    3. Preparing programming environment
      1. Titanic survival revisited with DL4J
        1. Multilayer perceptron network construction
          1. Hidden layer 1
          2. Hidden layer 2
          3. Output layer
        2. Network training
      2. Evaluating the model
    4. Cancer type prediction using an LSTM network
      1. Dataset preparation for training
      2. Recurrent and LSTM networks
      3. Dataset preparation
      4. LSTM network construction
      5. Network training
      6. Evaluating the model
    5. Frequently asked questions (FAQs)
    6. Summary
    7. Answers to questions
  8. Multi-Label Image Classification Using Convolutional Neural Networks
    1. Image classification and drawbacks of DNNs
    2. CNN architecture
      1. Convolutional operations
      2. Pooling and padding operations
        1. Fully connected layer (dense layer)
    3. Multi-label image classification using CNNs
      1. Problem description
      2. Description of the dataset
        1. Removing invalid images
      3. Workflow of the overall project
        1. Image preprocessing
      4. Extracting image metadata
      5. Image feature extraction
        1. Preparing the ND4J dataset
      6. Training, evaluating, and saving the trained CNN models
        1. Network construction
        2. Scoring the model
        3. Submission file generation
      7. Wrapping everything up by executing the main() method
    4. Frequently asked questions (FAQs)
    5. Summary
    6. Answers to questions
  9. Sentiment Analysis Using Word2Vec and LSTM Network
    1. Sentiment analysis is a challenging task
    2. Using Word2Vec for neural word embeddings
    3. Datasets and pre-trained model description
      1. Large Movie Review dataset for training and testing
        1. Folder structure of the dataset
      2. Description of the sentiment labeled dataset
      3. Word2Vec pre-trained model
    4. Sentiment analysis using Word2Vec and LSTM
      1. Preparing the train and test set using the Word2Vec model
      2. Network construction, training, and saving the model
      3. Restoring the trained model and evaluating it on the test set
      4. Making predictions on sample review texts
    5. Frequently asked questions (FAQs)
    6. Summary
    7. Answers to questions
  10. Transfer Learning for Image Classification
    1. Image classification with pretrained VGG16
      1. DL4J and transfer learning
    2. Developing an image classifier using transfer learning
      1. Dataset collection and description
      2. Architecture choice and adoption
      3. Train and test set preparation
      4. Network training and evaluation
      5. Restoring the trained model and inferencing
    3. Making simple inferencing
    4. Frequently asked questions (FAQs)
    5. Summary
    6. Answers to questions
  11. Real-Time Object Detection using YOLO, JavaCV, and DL4J
    1. Object detection from images and videos
      1. Object classification, localization, and detection
        1. Convolutional Sliding Window (CSW)
      2. Object detection from videos
    2. You Only Look Once (YOLO)
    3. Developing a real-time object detection project
      1. Step 1 – Loading a pre-trained YOLO model
      2. Step 2 – Generating frames from video clips
      3. Step 3 – Feeding generated frames into Tiny YOLO model
      4. Step 4 – Object detection from image frames
      5. Step 5 – Non-max suppression in case of more than one bounding box
      6. Step 6 – wrapping up everything and running the application
    4. Frequently asked questions (FAQs)
    5. Summary
    6. Answers to questions
  12. Stock Price Prediction Using LSTM Network
    1. State-of-the-art automated stock trading
    2. Developing a stock price predictive model
      1. Data collection and exploratory analysis
      2. Preparing the training and test sets
      3. LSTM network construction
      4. Network training, and saving the trained model
      5. Restoring the saved model for inferencing
      6. Evaluating the model
    3. Frequently asked questions (FAQs)
    4. Summary
    5. Answers to questions
  13. Distributed Deep Learning – Video Classification Using Convolutional LSTM Networks
    1. Distributed deep learning across multiple GPUs
      1. Distributed training on GPUs with DL4J
    2. Video classification using convolutional – LSTM
      1. UCF101 – action recognition dataset
      2. Preprocessing and feature engineering
        1. Solving the encoding problem
        2. Data processing workflow
        3. Simple UI for checking video frames
      3. Preparing training and test sets
      4. Network creation and training
      5. Performance evaluation
    3. Distributed training on AWS deep learning AMI 9.0
    4. Frequently asked questions (FAQs)
    5. Summary
    6. Answers to questions
  14. Playing GridWorld Game Using Deep Reinforcement Learning
    1. Notation, policy, and utility for RL
      1. Notations in reinforcement learning
      2. Policy
      3. Utility
    2. Neural Q-learning
      1. Introduction to QLearning
      2. Neural networks as a Q-function
    3. Developing a GridWorld game using a deep Q-network
      1. Generating the grid
        1. Calculating agent and goal positions
        2. Calculating the action mask
        3. Providing guidance action
        4. Calculating the reward
        5. Flattening input for the input layer
      2. Network construction and training
    4. Playing the GridWorld game
    5. Frequently asked questions (FAQs)
    6. Summary
    7. Answers to questions
  15. Developing Movie Recommendation Systems Using Factorization Machines
    1. Recommendation systems
      1. Recommendation approaches
        1. Collaborative filtering approaches
        2. Content-based filtering approaches
        3. Hybrid recommender systems
        4. Model-based collaborative filtering
      2. The utility matrix
        1. The cold-start problem in collaborative-filtering approaches
    2. Factorization machines in recommender systems
    3. Developing a movie recommender system using FMs
      1. Dataset description and exploratory analysis
      2. Movie rating prediction
        1. Converting the dataset into LibFM format
        2. Training and test set preparation
        3. Movie rating prediction
      3. Which one makes more sense ;– ranking or rating?
    4. Frequently asked questions (FAQs)
    5. Summary
    6. Answers to questions
  16. Discussion, Current Trends, and Outlook
    1. Discussion and outlook
      1. Discussion on the completed projects
        1. Titanic survival prediction using MLP and LSTM networks
        2. Cancer type prediction using recurrent type networks
        3. Image classification using convolutional neural networks
        4. Sentiment analysis using Word2Vec and the LSTM network
        5. Image classification using transfer learning
        6. Real-time object detection using YOLO, JavaCV, and DL4J
        7. Stock price prediction using LSTM network
        8. Distributed deep learning – video classification using a convolutional-LSTM network
        9. Using deep reinforcement learning for GridWorld
        10. Movie recommender system using factorization machines
    2. Current trends and outlook
      1. Current trends
      2. Outlook on emergent DL architectures
        1. Residual neural networks
        2. GANs
        3. Capsule networks (CapsNet)
        4. Semantic image segmentation
        5. Deep learning for clustering analysis
    3. Frequently asked questions (FAQs)
    4. Answers to questions
  17. Other Books You May Enjoy
    1. Leave a review - let other readers know what you think