CRN Fast50 Award

CRN Fast50 for 2019 Award

CRN Fast50 - Number 15TechConnect was listed in the CRN Fast50 for 2019, settling into the 15th position in our debut year. A day after receiving the Deloitte’s Technology Fast 50 awards we were again presented a great result. Read about the Deloitte’s Technology Fast 50 here if you missed it.

The CRN Fast50 award, now in its 11th year, recognises the fastest-growing companies in the Australian IT channel, based on year-on-year revenue growth. “The 2019 CRN Fast50 put up astounding numbers: they grew at least 15 times faster than Australia’s economy.” – Simon Sharwood, Editorial Director – CRN. CRN Fast50 Award

This was the first year that TechConnect has entered this award and are thrilled to be listed 15th, with a growth rate of 67%. Simon Sharwood also stated, “It’s a huge achievement to have made it into the CRN Fast50. Your company’s growth not only outpaced most others in our industry, it also vastly exceeds Australia’s current overall growth rate!”.

This is a great achievement for us, we would like to thank our customers and team, without them this would not have been possible. Team TechConnect would also like to extend a congratulations to all the other winners. TechConnect looks forward to expanding our growth and moving up the list in coming years.CRN Fast50 - Clinton Thomson

Deloittes Technology Fast50

Deloitte – Technology Fast 50 Australia 2019

Deloittes Fast50 AwardWe are extremely excited and honoured to have been listed as one of Deloitte’s Technology Fast 50 Australian companies. Ranking 43rd on the list with a growth rate of 161%, in our debut year. This is a huge achievement not only for the company but also for our team and the hard work they have put in to provide solutions for our customers.

“Now in its 18th year in Australia, the Deloitte Technology Fast 50 program ranks fast growing technology companies, public or private, based on percentage revenue growth over three years.” – DeloitteDeloittes Technology Fast50

“More than ever, this year showcases world-leading Australian business innovation and it is a tremendous achievement for any company to be named among the Deloitte Technology Fast 50,” Deloitte Private Partner and Technology Fast 50 Leader, Josh Tanchel.

With our significant growth over the years, our hard-working team and most importantly our valued customers, we were able to achieve this amazing outcome. TechConnect is getting ready for exponential growth, through expanding into new markets and deep data specialisations.

The awards night was held on Wednesday, 20th of November in Sydney at the Museum of Contemporary Art. Clinton, our Director, was there to accept the award on behalf of TechConnect. “It was a great night; Well done to all the other recipients and thank you to Deloitte’s for putting it all together.” Clinton Thomson, TechConnect IT Solutions.Deloitte Fast50 - Clinton Thomson

IntelliHQ - AWS - ECG Live Stream

IntelliHQ uses Machine Learning on AWS to create a web-based ECG live stream

The coming 4th Industrial Revolution – an exponential convergence of digital, physical, technological and biological advances – will transform industries over the course of the 21st century. No single innovation will lead this impending revolution, but one thing is clear: Artificial Intelligence (AI) will be at the forefront.

Healthcare is among the foremost industries ripe to be revolutionized by AI and the 4th Industrial Revolution. By enabling ground-breaking advances in healthcare digitisation, AI is expected to significantly contribute to medical advances and lead to marked improvements to healthcare delivery.

 

Embracing AI to revolutionize healthcare

A not-for-profit partnership between Gold Coast Health, industry and universities, IntelliHQ (Intelligent Health Queensland) is dedicated to promoting research, investment, and monetization of next-generation AI and machine learning technologies in the health sector. It aims to enhance patient outcomes, improve quality of care, create opportunities for skills, jobs and venture development, and encourage investment. By harnessing trusted AI, IntelliHQ aspires to become a globally recognised healthcare innovation and commercialization hub.

Building a global healthcare AI capability promises to deliver significant benefits, not only by relieving pressure on the medical system resulting from spiralling costs, but also by contributing to broader technological economic growth, global competitiveness, and skill creation.

But to realize its aspirations, IntelliHQ has to overcome several challenges and obstacles to AI adoption in healthcare. It needs to build community trust, and maintain secure access to patient data. As such, IntelliHQ needed a technology partner to enable it to achieve its goals.

 

IntelliHQ engages TechConnect

To enable its key initiatives, IntelliHQ worked with AWS Partner Network (APN) Advanced Consulting Partner, TechConnect to create a web-based ECG live stream with machine learning annotations as a proof-of-concept. This requires numerous cloud technologies for data security, storage, transformation, and means for deployment.

An ECG signal can be categorised into either a normal (healthy) signal or various types of abnormal (unhealthy) classifications, such as atrial fibrillation. Key health indicators are the standard deviation of the length of time between peaks and troughs in an ECG signal, and the ratio between low frequency vs high frequency signals.

It’s possible to generate annotations of these intervals and apply an algorithm to the resulting data to make classifications without machine learning. But given the ability for machine learning to make increasingly sophisticated classifications and predictions, applying these technologies to health data presents many advantages.

 

The Solution

To extract ICU data to the cloud, IntelliHQ used TechConnect’s Panacea toolset, a C# library and Windows service that connects to a GE Carescape Gateway High Speed Data Interface, subscribe to data feeds and push these data feeds to the cloud via AWS Kinesis Firehose, Amazon’s high speed data ingestion service.

As actual ICU data could not be streamed from a hospital to the cloud until all custodianship processes has been finalised, this proof-of-concept utilised a demonstration monitor to simulate a typical healthy heartbeat, several abnormal rhythms, and test with various combinations of leads connected.

Once subscribed to a data feed, the Windows service inspects each packet to identify source information, and then converts the ECG waveform and extra numeric data into a hexadecimal representation for transport to the cloud. The source information is parsed by an AWS Lambda function, which then writes the data into an Amazon S3 folder structure that uses folder names for a simple organisational scheme.

Parameters are extracted from the AWS Kinesis Firehose stream data by the Amazon Lambda function in a structure format that reflects the default naming convention for Hive partitions on Amazon S3. Many AWS and Hadoop compatible tools (like Amazon Athena) can use this partitioning scheme to efficiently select subsets of data when queried by these parameters.

Once the data was uploaded to Amazon S3 via Panacea in its proprietary raw hex format, they required conversion to a broadly supported file format using an Amazon EMR cluster to handle the parallel transform operations, for which Zeppelin was chosen. It exposes a web-accessible notebook interface to run code and display resulting visualisations, and each notebook consists of a sequence of cells which can utilise a different parser. This provided easy access to Spark, SQL and Scala for data analytics.

IntelliHQ then unpackaged the raw waveform and numerics data into a human readable tabular file format using a combination of PySpark and SparkSQL code. They chose the widely supported csv format, and created annotation files that labelled normal vs abnormal waveform periods. The next data preparation steps took place in Amazon Sagemaker, which gave access to serverless resources for training and deployment. After the addition of front end graphics, the resulting visualization displays in a simple UI. The code is then packaged with Amazon Elastic Container Service for deployment.

ECG Live Stream - IntelliHQ - AWS

 

The Benefits

The proof-of-concept process results in significant query time improvements and, for tools like Amazon Athena, substantial query cost savings. Furthermore, the folder structure is self documenting and unambiguous, allowing a highly decoupled architecture that can handle any future growth in data volume.

Also the data is non-public, and AWS Identity and Access Management (IAM) credentials establish who has access rights. Security tags and security groups enable IntelliHQ to allocate who has access to data at different stages of preparation. Because these cloud services come with baked-in security, IntelliHQ can ensure they have strong control over health data.

 

The Outcome

The web-based ECG live stream proof-of-concept showed that efficient, secure web services enable IntelliHQ to build effective, scalable cloud solutions. By embracing AI and machine learning, IntelliHQ will continue to advance the possibilities of commercialized healthcare innovation.

 

Download white paper here

Jason Leith - Amazon Web Services - CEO

TechConnect Appoints Jason Leith as CEO

Jason Leith - Amazon Web Services - CEO

Amazon Web Services enterprise accounts manager, Jason Leith, to spearhead growth for Queensland company TechConnect IT Solutions

TechConnect IT Solutions, a leading provider of cloud services and an AWS Advanced Consulting Partner, today announces the appointment of Jason Leith as its new Chief Executive Officer.  Leith joins TechConnect as its first CEO and will take over the leadership and operations of the company from founder and former Managing Director, Michael (Mike) Cunningham.  Leith will be tasked with growing the TechConnect business across Australia, particularly in the large Enterprise and Government markets.  Mike Cunningham will step into the General Manager role.

Cunningham said that Leith was selected for his pedigree in growing data services businesses in enterprise and government markets, and his strong customer-first philosophy.

“Jason will help us to reach the next stage of maturity at TechConnect.  We have seen an intense bout of market consolidation in the data services and digital marketplace with several recent mergers and acquisitions.  We know we have a great offering at TechConnect and we’re backing ourselves for significant growth”, said Mike Cunningham, Founder and now General Manager of TechConnect.

“The change to our management structure, and the appointment of Jason Leith as our new CEO is the key first step in preparing us for the exponential growth we’re anticipating.”

Leith, who joins TechConnect from Amazon Web Services, has had a long and successful career in sales and territory management roles in the enterprise software, IT as a service, Software as a Service and Cloud Services markets.

Leith has previously worked in regional and global leadership, sales and account executive roles with Google, AWS, VMWare and Data#3.

“I am incredibly excited and honoured to be joining TechConnect.  I have had a long association with the team at TechConnect and have charted their growth in Australia over recent years.  The company has a strong culture and some of the finest technical minds in the industry”, said Jason Leith, CEO TechConnect.

“I’m looking forward to leading the next stage of growth for TechConnect.  I have a strong customer experience focus and believe in always starting projects, no matter how technical, from the customer’s business perspective.”

“TechConnect’s vision statement is ‘helping customers extract business value from data’. This aligns with my view of the world about creating value for customers and putting their overall experience first.”, said Leith.

TechConnect is an expert in the delivery of data services projects with clients in mining, healthcare, retail, transport, online gaming and more.  TechConnect will continue its expansion into areas of Machine Learning and Artificial Intelligence and in the near future, under Leith’s stewardship, will add a Data Strategy Sprint capability to its portfolio.

As part of its growth and maturity plans, TechConnect is also currently recruiting for a Chief Technology Officer.

TechConnect has plans to grow its team to 100+ people over the next three to five years, creating graduate employment and professional development opportunities in Queensland and throughout Australia.

The company has offices in Brisbane and the Gold Coast and has a graduate pathways program for top students in the STEM fields.

Related Articles: ARN & CRN

5 Mistakes to Avoid when Migrating to the Cloud

5 Mistakes to Avoid – When Migrating to the Cloud

5 Mistakes to Avoid when Migrating to the Cloud

 

What's the difference between Artificial Intelligence (AI) & Machine Learning (ML)?

What’s the difference between Artificial Intelligence (AI) & Machine Learning (ML)?

What’s the difference between Artificial Intelligence (AI) & Machine Learning (ML)?

The field of Artificial Intelligence encompasses all efforts at imbuing computational devices with capabilities that have traditionally been viewed as requiring human-level intelligence. 

This includes:

  • Chess, go and generalised game playing 
  • Planning and goal-directed behaviour in dynamic and complex environments 
  • Theorem proving, proof assistants and symbolic reasoning 
  • Computer vision  
  • Natural language understanding and translation 
  • Deductive, inductive and abductive reasoning 
  • Learning from experience and existing data 
  • Understanding and emulating emotion 
  • Fuzzy and probabilistic (Bayesean) reasoning 
  • Communication, teamwork, negotiation and argumentation between self-interested agents 
  • Early advances in signal processing (text to speech) 
  • Music understanding and creation 

Like intelligence itself it defies definition.

As a field, it predates Machine Learning and Machine Learning was seen as an early sub-field. Many things that are obvious or no longer considered AI have their roots in the field. Many database models (hierarchical, network and relational) have their roots in AI research. Optimisation and scheduling were early problems tackled under the umbrella of AI. Minsky’s Frame model reads like an early description of Object Oriented programming. LISP, Prolog and many other programming languages and programming language properties emerged as tools for or as a result of AI research.

Neural networks (a sub-field of machine learning) emerged in the 80s in the form of perceptrons and were heavily studied until it was demonstrated that a perceptron was unable to calculate XOR. However, with the invent of error back propagation over networks of perceptrons (a way to systematically train the weights between neurons) it was shown that neural networks have equivalent computational power to universal turing machines (if it can be computed on a turing machine a correctly configured neural network can also implement that same function).

With the invent of Deep Learning in the 2010s the popularity of machine learning has soared as great successes have been achieved using the approach. Due to limits on computational power, traditional neural networks were trained on meticulously human engineered features of the datasets, not the raw datasets themselves. With the progress in cloud, gpus and distributed learning it became possible to create much larger and deeper neural networks. This progressed to the point that large raw datasets could be used directly to train with and get predictions from. In so doing the neural networks extract their own features from the data as part of this process. Many of the recent advances have been achieved due to this (in addition to better neuron activation functions, faster training algorithms, new network architectures).  The successes have also inspired people to use Deep Learning as a means of solving some of the other problems in general AI (as discussed above) and this may explain why a convergence or confusion between AI and Machine Learning is perceived by many.

AWS DeepLens TechConnect IoT Rule

AWS DeepLens: Creating an IoT Rule (Part 2 of 2)

This post is the second in a series on getting started with the AWS DeepLens. In Part 1, we introduced a program that could detect faces and crop them by extending the boilerplate Greengrass Lambda and pre-built model provided by AWS. This focussed on the local capabilities of the device, but the DeepLens device is much more than that. At its core, DeepLens is a fully fledged IoT device, which is just one part of the 3 Pillars of IoT: devices, cloud and intelligence.

All code and templates mentioned can be found here. This can be deployed using AWS SAM, which helps reduces the the complexity for creating event-based AWS Lambda functions.

Sending faces to IoT Message Broker

AWS DeepLens Device Page

AWS DeepLens Device Console Page

When registering a DeepLens device, AWS creates all things associated with the IoT cloud pillar . If you have a look for yourself in the IoT Core AWS console page, you will see existing IoT groups, devices, certificates, etc.. This all simplifies the process of interacting with the middle-man, the MQTT topic that is displayed on the main DeepLens device console page. The DeepLens (and others if given authorisation) has the right to publish messages to the IoT topic within certain limits.

Previously, the AWS Lambda function responsible for detecting faces only showed them on the output streams and was only publishing to the MQTT topic the threshold of detected faces. We can modify this by including cropped face images as part of the packets that are sent to the topic.

The Greengrass function below extends the original version by publishing a message for each detected face. Encoded cropped face images are set in the “image_string” key of the object. IoT messages have a size limit of 128 KB, but the images will be well within the limit and encoded in Base64.


# File "src/greengrassHelloWorld.py" in code repository
from threading import Thread, Event
import os
import json
import numpy as np
import awscam
import cv2
import greengrasssdk

class LocalDisplay(Thread):
    def __init__(self, resolution):
    ...
    def run(self):
    ...
    def set_frame_data(self, frame):
    ....

    def set_frame_data_padded(self, frame):
        """
        Set the stream frame and return the rendered cropped face
        """
        ....
        return outputImage

def greengrass_infinite_infer_run():
    ...
    # Create a local display instance that will dump the image bytes
    # to a FIFO file that the image can be rendered locally.
    local_display = LocalDisplay('480p')
    local_display.start()
    # The sample projects come with optimized artifacts,
    # hence only the artifact path is required.
    model_path = '/opt/awscam/artifacts/mxnet_deploy_ssd_FP16_FUSED.xml'
    ...
    while True:
        # Get a frame from the video stream
        ret, frame = awscam.getLastFrame()
        # Resize frame to the same size as the training set.
        frame_resize = cv2.resize(frame, (input_height, input_width))
        ...
        model = awscam.Model(model_path, {'GPU': 1})
        # Process the frame
        ...
        # Set the next frame in the local display stream.
        local_display.set_frame_data(frame)

        # Get the detected faces and probabilities
        for obj in parsed_inference_results[model_type]:
            if obj['prob'] > detection_threshold:
                # Add bounding boxes to full resolution frame
                xmin = int(xscale * obj['xmin']) \
                       + int((obj['xmin'] - input_width / 2) + input_width / 2)
                ymin = int(yscale * obj['ymin'])
                xmax = int(xscale * obj['xmax']) \
                       + int((obj['xmax'] - input_width / 2) + input_width / 2)
                ymax = int(yscale * obj['ymax'])

                # Add face detection to iot topic payload
                cloud_output[output_map[obj['label']]] = obj['prob']

                # Zoom in on Face
                crop_img = frame[ymin - 45:ymax + 45, xmin - 30:xmax + 30]
                output_image = local_display.set_frame_data_padded(crop_img)

                # Encode cropped face image and add to IoT message
                frame_string_raw = cv2.imencode('.jpg', output_image)[1]
                frame_string = base64.b64encode(frame_string_raw)
                cloud_output['image_string'] = frame_string

                # Send results to the cloud
                client.publish(topic=iot_topic, payload=json.dumps(cloud_output))
        ...

greengrass_infinite_infer_run()

Save faces to S3 with an IoT Rule

The third IoT pillar intelligence interacts with the cloud pillar, which uses insights to perform actions on other AWS and/or external services. Our goal is to have all detected faces saved to an S3 bucket in the original JPEG format before we encoded it to Base64. To achieve this, we need to create an IoT rule that will launch an action to do so.

IoT Rules listen for incoming MQTT messages of a topic and when a certain condition is met, it will launch an action. The messages from the queue are analysed and transformed using a provided SQL statement. We want to act on all messages, passing on data captured by the DeepLens device and also inject the “unix_time” property. The IoT Rule Engine will allow us to construct statements that do just that, calling the timestamp function within a SQL statement to add it to the result, as seen in the statement below.


# MQTT message
{
    "image_string": "/9j/4AAQ...",
    "face": 0.94287109375
}

# SQL Statement 
SELECT *, timestamp() as unix_time FROM '$aws/things/deeplens_topic_name/infer'

# IoT Rule Action event
{
    "image_string": "/9j/4AAQ...",
    "unix_time": 1540710101060,
    "face": 0.94287109375
}

The action is an AWS Lambda function (seen below) that is given an S3 Bucket name and an event. At a minimum, the event must contain properties: “image_string” representing the encoded image and “unix_time” which used for the name of the file. The last property is not something that is provided when the IoT message is published to the MQTT topic but instead is added by the IoT rule that calls the action.


# File "src/process_queue.py" in code repository
import os
import boto3
import json
import base64

def handler(event, context):
    """
    Decode a Base64 encoded JPEG image and save to an S3 Bucket with an IoT Rule
    """
    # Convert image back to binary
    jpg_original = base64.b64decode(event['image_string'])

    # Save image to S3 with the timestamp as the name
    s3_client = boto3.client('s3')
    s3_client.put_object(
        Body=jpg_original,
        Bucket=os.environ["DETECTED_FACES_BUCKET"],
        Key='{}.jpg'.format(event['unix_time']),
    )

Deploying an IoT Rule with AWS SAM

AWS SAM makes it incredibly easy to deploy an IoT Rule as it is a supported event type for Serverless function resources, a high-level wrapper for AWS Lambda. By providing only the DeepLens topic name as a parameter for the template below, a fully event-driven and least privilege AWS architecture is deployed.


# File "template.yaml" in code repository
AWSTemplateFormatVersion: '2010-09-09'
Transform: 'AWS::Serverless-2016-10-31'

Parameters:
  DeepLensTopic:
    Type: String
    Description: Topic path for DeepLens device "$aws/things/deeplens_..."

Resources:
  ProcessDeepLensQueue:
    Type: AWS::Serverless::Function
    Properties:
      Runtime: python2.7
      Timeout: 30
      MemorySize: 256
      Handler: process_queue.handler
      CodeUri: ./src
      Environment:
        Variables:
          DETECTED_FACES_BUCKET: !Ref DetectedFaces

      Policies:
        - S3CrudPolicy:
            BucketName: !Ref DetectedFaces

      Events:
        DeepLensRule:
          Type: IoTRule
          Properties:
            Sql: !Sub "SELECT *, timestamp() as unix_time FROM '${DeepLensTopic}'"

  DetectedFaces:
    Type: AWS::S3::Bucket
AWS DeepLens TechConnect

AWS DeepLens: Getting Hands-on (Part 1 of 2)

TechConnect recently acquired two AWS DeepLens to play around with. Announced at Re:Invent 2017, the AWS DeepLens is a small Intel Atom powered Deep Learning focused device with an embedded High-Definition video camera. The DeepLens runs AWS Greengrass, allowing quick compute for local events without having to send a large amount of data for processing on the cloud. This can substantially help businesses reduce costs, sensitive information transfer, and latency response for local events.

Zero to Hero (pick a sample project)

AWS DeepLens Face Detection Project

Creating a face detection AWS DeepLens project

What I think makes the DeepLens special, is how easy it is to get started using computer vision models to process visual surroundings on the device itself. TechConnect has strong capabilities in Machine Learning, but I myself haven’t had much of a chance to play around with Deep Learning frameworks like MxNet or Tensorflow. Thankfully, AWS provides a collection of pre-trained models and projects to help anyone get started. But if you are quite savvy already in those frameworks, you can train and use your own models too.

Face Detection Lambda Function

AWS DeepLens Face Detection Lambda Function

AWS DeepLens Face Detection Lambda Function

An AWS DeepLens project consists of a trained model and an AWS Lambda function (written in Python) at its core. These are deployed to the device to run via AWS Greengrass, where the AWS Lambda function continually processes each frame of coming in from the video feed using the awscam module.

The function can access the model that is downloaded as an accessible artifact on the device at the path. This location and others (example: “/tmp”) have permissions granted to the function from the AWS Greengrass group which is associated with the DeepLens project. I chose the face detection sample project, which processes faces in a video frame captured from the DeepLens camera and draws a rectangle around them.


from threading import Thread, Event
import os
import json
import numpy as np
import awscam
import cv2
import greengrasssdk

class LocalDisplay(Thread):
    def __init__(self, resolution):
    ...
    def run(self):
    ...
    def set_frame_data(self, frame):
    ....

def greengrass_infinite_infer_run():
    ...
    # Create a local display instance that will dump the image bytes
    # to a FIFO file that the image can be rendered locally.
    local_display = LocalDisplay('480p')
    local_display.start()
    # The sample projects come with optimized artifacts,
    # hence only the artifact path is required.
    model_path = '/opt/awscam/artifacts/mxnet_deploy_ssd_FP16_FUSED.xml'
    ...
    while True:
        # Get a frame from the video stream
        ret, frame = awscam.getLastFrame()
        # Resize frame to the same size as the training set.
        frame_resize = cv2.resize(frame, (input_height, input_width))
        ...
        model = awscam.Model(model_path, {'GPU': 1})
        # Process the frame
        ...
        # Set the next frame in the local display stream.
        local_display.set_frame_data(frame)
        ...

greengrass_infinite_infer_run()

Extending the original functionality: AWS DeepLens Zoom Enhance!

AWS DeepLens Face Detection Enhance

AWS DeepLens Face Detection Enhance

I decided to have a bit of fun and extend the original application functionality by cropping and enhancing a detected face. The DeepLens project video output set to 480p definition, but the camera frames from the device are much higher than this! So reusing the code from the original sample that drew a rectangle around each detected face, I was able to capture a face and display that on the big screen. The only difficult thing was centring the captured face and adding padding, bringing back bad memories of how hard centring an image in CSS used to be!


from threading import Thread, Event
import os
import json
import numpy as np
import awscam
import cv2
import greengrasssdk

class LocalDisplay(Thread):
    def __init__(self, resolution):
    ...
    def run(self):
    ...
    def set_frame_data(self, frame):
        # Get image dimensions
        image_height, image_width, image_channels = frame.shape

        # only shrink if image is bigger than required
        if self.resolution[0] < image_height or self.resolution[1] < image_width:
            # get scaling factor
            scaling_factor = self.resolution[0] / float(image_height)
            if self.resolution[1] / float(image_width) < scaling_factor:
                scaling_factor = self.resolution[1] / float(image_width)

            # resize image
            frame = cv2.resize(frame, None, fx=scaling_factor, fy=scaling_factor, interpolation=cv2.INTER_AREA)

        # Get image dimensions and padding after scaling
        image_height, image_width, image_channels = frame.shape

        x_padding = self.resolution[0] - image_width
        y_padding = self.resolution[1] - image_height

        if x_padding <= 0:
            x_padding_left, x_padding_right = 0, 0
        else:
            x_padding_left = int(np.floor(x_padding / 2))
            x_padding_right = int(np.ceil(x_padding / 2))

        if y_padding  detection_threshold:
            # Add bounding boxes to full resolution frame
            xmin = int(xscale * obj['xmin']) \
                   + int((obj['xmin'] - input_width / 2) + input_width / 2)
            ymin = int(yscale * obj['ymin'])
             max = int(xscale * obj['xmax']) \
                   + int((obj['xmax'] - input_width / 2) + input_width / 2)
            ymax = int(yscale * obj['ymax'])

            # Show Enhanced Face
            crop_img = frame[ymin - 45:ymax + 45, xmin - 30:xmax + 30]
            local_display.set_frame_data(crop_img)
            time.sleep(5)
        ...

def greengrass_infinite_infer_run():
    ...
    while True:
        # Get a frame from the video stream
        ret, frame = awscam.getLastFrame()
        # Resize frame to the same size as the training set.
        frame_resize = cv2.resize(frame, (input_height, input_width))
        ...
        model = awscam.Model(model_path, {'GPU': 1})
        # Process the frame
        ...
        # Set the non-cropped frame in the local display stream.
        local_display.set_frame_data(frame)
        
        # Get the detected faces and probabilities
        for obj in parsed_inference_results[model_type]:
           if obj['prob'] > detection_threshold:
               # Add bounding boxes to full resolution frame
               xmin = int(xscale * obj['xmin']) \
                      + int((obj['xmin'] - input_width / 2) + input_width / 2)
               ymin = int(yscale * obj['ymin'])
               xmax = int(xscale * obj['xmax']) \
                      + int((obj['xmax'] - input_width / 2) + input_width / 2)
               ymax = int(yscale * obj['ymax'])

               # Add face detection to iot topic payload
               cloud_output[output_map[obj['label']]] = obj['prob']

               # Zoom in on Face
               crop_img = frame[ymin - 45:ymax + 45, xmin - 30:xmax + 30]
               local_display.set_frame(crop_img)

        # Send results to the cloud
        client.publish(topic=iot_topic, payload=json.dumps(cloud_output))

greengrass_infinite_infer_run()
Machine Learning using Convolutional Neural Networks

Machine Learning with Amazon SageMaker

Computers are generally programmed to do what the developer dictates and will only behave predictably under the specified scenarios.

In recent years, people are increasingly turning to computers to perform tasks that can’t be achieved with traditional programming, which previously had to be done by humans performing manual tasks.   Machine Learning gives computers the ability to ‘learn’ and act on information based on observations without being explicitly programmed.

TechConnect entered the recent Get 2 the Core challenge on Unearthed’s crowd sourcing platformThis is TechConnect’s story, as part of the crowd sourcing approach, and does not imply or assert in any way that Newcrest Mining endorse Amazon Web Services or the work TechConnect have performed in this challenge.

Business problem

Currently a team at Newcrest Mining manually crop photographs of drill core samples before the photos can be fed into a system which detects the material type. This is extremely time-consuming due to the large number of photos. Hence why Newcrest Mining used crowd sourcing via the Unearthed platform, a platform bringing data scientists, start-ups and the energy & natural resources industry together.

Being able to automatically identify bounding box co-ordinates of the samples within an image would save 80-90% of the time spent preparing the photos.

Input Image

Machine Learning using Convolutional Neural Networks

Expected Output Image

Machine Learning using Convolutional Neural Networks

 

Before we can begin implementing an object-detection process, we first need to address a variety of issues with the photographs themselves, being:

  • Not all photos are straight
  • Not all core trays are in a fixed position relative to the camera
  • Not all photos are taken perpendicular to the core trays introducing a perspective distortion
  • Not all photos are high-resolution

In addition to the object-classification, we need to use an image-classification process to classify each image into a group based on the factors above. The groups are defined as:

Group 0 – Core trays are positioned correctly in the images with no distortion. This is the ideal case
Group 1 – Core trays are misaligned in the image
Group 2 – Core trays have perspective distortion
Group 3 – Core trays are misaligned and have perspective distortion
Group 4 – The photo has a low aspect ratio
Group 5 – The photo has a low aspect ratio and are misaligned

CNN Image Detection with Amazon Sagemaker

Solution

We tried to solve this problem using Machine Learning. In particular, we used supervised learning. When conducting supervised learning the system is provided with the input data and the classification/label desired output for each data point. The system learns a model that when provided a previously seen input will reliably output the correct labelling or the most likely label when an unseen input is provided.

This differs from unsupervised learning. When utilising unsupervised techniques, the target label is unknown and the system must group or derive the label from the inherent properties within the data set itself.

The Supervised Machine Learning process works by:

  1. Obtaining, preparing & labelling the input data
  2. Create a model
  3. Train the model
  4. Test the model
  5. Deploy & use the model

There are many specific algorithms for supervised learning that are appropriate for different learning tasks. The object detection and classification problem of identifying core samples in images is particularly suited to a technique known as convolutional neural networks. The model ‘learns’ by assigning and constantly adjusting internal weights and biases for each input of the training data to produce the specified output. The weights and biases become more accurate with more training data.

Amazon SageMaker provides a hosted platform that enabled us to quickly build, train, test and deploy our model.

Newcrest Mining provided a large collection of their photographs which contain core samples. A large subset of the photos also contained the expected output, which we used to train our model.

The expected output is a set of four (X, Y) coordinates per core sample in the photograph. The coordinates represent the corners of the bounding box that surrounds the core sample. Multiple sets of coordinates are expected for photos that contain multiple core samples.

The Process

We uploaded the supplied data to an AWS S3 bucket, using a separate prefix to separate images which we were provided the expected output for, and those with no output. S3 is an ideal store for the raw images with high durability, infinite capacity and direct integration with many other AWS products.

We further randomly split the photos with the expected output into a training dataset (70%) and a testing dataset (30%).

We created a Jupyter notebook on an Amazon SageMaker notebook instance to host and execute our code. By default the Jupyter notebook instance provides access to a wide variety of common data science tools such as numpy, tensorflow and matplotlib in addition to the Amazon SageMaker and AWS python SDKs. This allowed us to immediately focus on our particular problem of creating SageMaker compatible datasets with which we could build and test our models.

We trained our model by feeding the training dataset along with the expected output into an existing Sagemaker built object detection model to fine tune it to our specific problem. SageMaker has a collection of hyperparameters which influence how the model ‘learns’. Adjusting the hyperparameter values affects the overall accuracy of the model and how long the training takes. As the training proceeded we were able to monitor the changes to the primary accuracy metric and pre-emptively cancel any training configurations that did not perform well. This saved us considerable time and money by allowing us to abort poor configurations early.

We then tested the accuracy of our model by feeding testing data – data it has never seen – without the output, then comparing the model’s output to the expected output.

After the first round of training we had our benchmark for accuracy. From there we were able to tune the model by iteratively adjusting the hyperparameters, model parameters and by augmenting the data set with additional examples then retraining and retesting. Setting the hyperparameter values is more of an artform than a science – trial and error is often the best way.

We used a technique which dynamically assigned values to the learning rate after each epoch, similar to a harmonic progression:

Harmonic Progression

This technique allowed us to start with large values to allow the model to converge quickly initially, then reduce the learning rate value by an increasingly smaller amount after each epoch as the model gets closer to an optimal solution.  After many iterations of tuning, training and testing we had improved the overall accuracy of the model compared with our benchmark, and with our project deadline fast approaching we decided that it was accurate as possible in the timeframe that we had.

We then used our model to classify and detect the objects in the remaining photographs that didn’t exist in the training set.  The following images show the bounding boxes around the cores that our model predicted:

CNN Bounding
CNN Bounding

Lessons Learned

Before we began we had an extremely high expectation of how accurate our model would be. In reality it wasn’t as accurate as our expectations.
We discussed things that could have made the model more accurate, train faster or both, including:

  • Tuning the hyperparameters using SageMakers automated hyperparameter tuning tooling
  • Copying the data across multiple regions to gain better access to the specific machine types we required for training
  • Increasing the size of the training dataset by:
    • Requesting more photographs
    • Duplicating the provided photographs and modifying them slightly. This included:
      • including duplicate copies of images and labels
      • including copies after converting the images to greyscale
      • including copies after changing the aspect ratio of the images
      • including copies after mirroring the images
  • Splitting the problem into separate, simpler machine learnable stages
  • Strategies for identifying the corners of the cores when they are not a rectangle in the image

During these discussions we realised we hadn’t defined a cut-off for when we would consider our model to be ‘accurate enough’.

As a general rule the accuracy of the models you build improve most rapidly in the first few iterations, after that the rate of improvement slows significantly. Each subsequent improvement requires lengthier training, more sophisticated algorithms and models, more sophisticated feature engineering or substantial changes to approach entirely. This trend is depicted in the following chart:

Learning accuracy over time

Depending on the use case, a model with an accuracy of 90% often requires significantly less training time, engineering effort and sophistication than a model with an accuracy of 93%. The acceptance criteria for a model needs to carefully balance these considerations to maximise the overall return on investment for the project.

In our case time was the factor that dictated when we stopped training and started using the model to produce the outputs for unseen photographs.

 

Thank you to the team at TechConnect that volunteered to try Amazon Sagemaker to address the Get 2 the Core Challenge posted by Newcrest Mining on the Unearthered portal.  Also big thanks for sharing lessons learned and putting this blog together!

How to Motivate your Team to get AWS Certified

How to Motivate your Team to get AWS Certification

In a recent Team Survey by Wattsnext HR Consultants, TechConnect scored off the charts for the Training and Development opportunities it offers Team Members. We put heaps of effort into this and are proud of the result. In light of this, we thought we would share some of our methodologies on how to motivate your team to get AWS certification.

TechConnect is a cloud-based consultancy firm and we require our team members to always be a few steps ahead of the customers when it comes to tech ability. We have found that studying and completing the AWS certification exams really do assist with fantastic project outcomes and delighted customers, so we have invested heavily in this area.

If  you have a group of over-worked Techies that crawl out the door after a 10 hour slog most days, how do you motivate and invigorate them to further their qualifications? Letting your techies take a moment to sharpen their axe rather than keeping them at it with a blunt one greatly benefits both your employees and your business.  Our proven program is outlined below and is with reference to the AWS exams, but can be altered for other Tech based exams.

 

TechConnect AWS Certification Training and exam ideas :

  • Speak to AWS about understanding their training programs and look at setting up a training plan for your business. The training they have is extremely relevant and the labs are gold.
  • Subscribe to the AWS online training portal.
  • Offer your team instructor-led training. These are nearly always 3-day courses with some very relevant Labs.
  • If you are not located near a training centre or have people that prefer their own space, give the team member 3 days off to complete the online study. We use A Cloud Guru and it has been great.
  • Wherever possible, give the person relevant work to give them experience on the particular tools they will be assessed on. Giving a person a lot of devops work when they are studying for the AWS Certified Big Data exam does not help.
  • Dependent on the exam, we give the person a day off prior to the exam to help them study and prepare.
  • Pay for the cost of the exam for the team member – on the proviso that they pass!
  • Our big clincher is that we have a menu of bonuses the team member gets for passing. We have heaps of guys completing the exams in the lead up to Christmas as they want a little extra cash for the Christmas period. By way of example:
    • Associate Exam – $500
    • Big Data Exam – $2,500
    • Professional Exam – $2,500
  • speak to your account manager to see if they can assist as AWS are usually very excited about us getting people AWS certification
  • Set-up Friday afternoon tech sessions where the guys can ask the more experienced team members the questions they have.
  • Ensure the leaders set good examples for the team. Two of our directors are AWS Certified Professional Architects.

At TechConnect we strongly believe that we are a learning organisation and all team members buy into this culture. Our team members give up their own time to ensure the others are well equipped to study for and take the exams. We’re all here to help support each other!

Outcomes of our program:

  • We have a highly qualified workforce that is ready to delight customers with their expertise.
  • We are looking to achieve several AWS competencies. TechConnect now have our sights on the Big Data competency and are nearly there. The certifications enable the competencies.
  • A knowledgeable workforce works faster which allows us to be competitive in an already competitive market
  • Retention – We have great employee retention due to the investment we make in the team members.  This reminds me of the age-old joke:

Two managers are talking about training their employees. The first asks, “Yeah, but what if we train them, and they just leave?” The second responds, “What if we don’t train them, and they stay?”

  • Lazy team members don’t like to get qualified whereas energetic team members do. We scare the lazy ones and attract the energetic ones who become the high performing team members. This in turn makes Tech Connect a high performing organisation.

At TechConnect, we have had remarkable results with investing in training and hope this article helps in some way in steering your ship. If you are an employee, share this with your Leaders so they can assist in getting you skilled. If they don’t and you believe you are one of the energetic ones, jump on our website and drop us an email 😊