Are you the publisher? Claim or contact us about this channel

Embed this content in your HTML


Report adult content:

click to rate:

Account: (login)

More Channels


Channel Catalog

Channel Description:

Factual News Aggregation on #iot, #blockchain, #artificialintelligence & #security
    0 0


    Global technology spending on the Internet of Things (IoT) is expected to reach $1.2 trillion (€1 trillion) in 2022, led by industries such as discrete manufacturing $119 billion (€108 billion), process manufacturing $78 billion (€70.8 billion), transportation $71 billion (€64.5 billion) and utilities $61 billion (€55.4 billion).

    Indeed, the market for Industry 4.0 products and services is expected to grow significantly over the next few years – and over 60% of manufacturers are expected to be fully connected by that time, utilising a change of technologies such as RFID, wearables and automated systems, says Ramya Ravichandar, VP Products, FogHorn.

    Although the industry anticipates positive growth in current and upcoming IoT and IIoT projects, some significant challenges still need to be addressed in order to fully win customer trust and move pilot projects into successful, large-scale IoT productions. While many see connectivity limitations, security risks, and data bias, including data quantity, issues as roadblocks to IoT success, we have found data quality also plays a critical role in delivering effective IoT projects.

    What is data quality – and how does it impact deployment success?

    Data quality plays a vital role in the increasing adoption of IoT devices in three main ways:

    1. Organisations can only make the right data-driven decisions if the data they use is correct and suitable for the use case at hand.
    2. Poor-quality data is practically useless – and can lead to severe issues, such as inaccurate machine learning models, inaccurate decision-making, or deficient ROI.
    3. Specifically, the classic problems of garbage in/garbage out resurfaced with the increase of artificial intelligence and machine learning applications.

    High-quality data feeds, trains, and tunes machine learning (ML) models to empower IoT-enabled factories to make informed data-driven decisions.

    For example, the unexpected failure of a steam turbine can create a critical disruption, damage, and economic loss to both the power plant and the downstream power grid. Predictive machine learning models, trained on high-quality data sets, help these industrial organisations maximise the reliability of their equipment by detecting potential failures before significant problems arise.

    However, dirty data, including data that is missing, incomplete, or error-prone, leads organisations to make inconvenient, time-consuming, and expensive mistakes. In fact, according to The Data Warehouse Institute (TDWI), dirty data costs U.S. companies around $600 billion (€545 billion) every year. It is a fact that about 80% of a data scientist’s job is focused on data preparation and cleansing to ensure that the ML models provide the right insights.

    Looking ahead, organisations must incorporate methodologies to ensure the completeness, validity, consistency, and correctness of its data streams to enhance insight quality, deploy effective IoT projects, and realise optimal ROI.

    So, what role does edge computing play in data quality?

    Industrial sensors come in many different types and collect high volumes, varieties, and velocities of data, including video, audio, acceleration, vibration, acoustic, and more. If an organisation is able to successfully align, clean, enrich and fuse all these various data streams, it can significantly improve the efficiency, health, and safety of their operations. However, to paint a complete, accurate picture of the factory operations, organisations must gather, marry and process the raw insights delivered by these varied, remote data sources.

    Ramya Ravichandar

    Edge computing thrives on these types of environments as they can gather and process real-time data at its inception, and then create a structure within the data to help identify the value.

    Edge-enabled machines help clean and format dirty data locally, which improves the training and deployment of accurate and effective machine learning models. Indeed, industry researchers believe edge-based use cases for IoT will be a powerful catalyst for growth across the key vertical markets – and that data will be processed (in some form) by edge computing in 59% of IoT deployments by 2025.

    For example, using edge computing, factories can improve product quality by analysing sensor data in real-time to identify any values that fall outside of previously defined thresholds, build and train an ML model to identify root problem causes, and, if desired, deploy the ML model to automatically stop the production of defective parts.

    For these, and similar, use cases, edge-enabled solutions transform real-time machine data (low-quality data) into actionable insights (high-quality data) related to production efficiency and quality metrics that can be used by operations managers to reduce unplanned downtime, maximise yield and increase machine utilisation.

    Many organisations are beginning to understand the value edge computing can bring to their IoT and IIoT projects, as edge solutions turn raw, streaming sensor data into actionable insights using real-time data processing and analytics. By cleansing and enriching dirty data at the point of its creation, edge computing can significantly enhance data quality and refine repetitive machine data for better operational efficiencies.

    The author is Ramya Ravichandar, VP products, FogHorn

    Comment on this article below or via Twitter: @IoTNow_OR @jcIoTnow

    This UrIoTNews article is syndicated fromIoT-Now

    0 0

    Image of persons blue eye

    Eye Disease Detection Using TensorFlow and Azure’s CustomVision.ai


    Globally, more than 1 billion people are affected by vision impairment or blindness due to unaddressed cataracts (65.2 million), glaucoma (6.9 million), and retina disease (3 million).

    Proposed here is the development of an AI-based system that uses the Azure Cognitive Services CustomVision tool to predict the probability of the existence of one of these chronic conditions in an eye scan.

    You may also enjoy:  How to Build Custom Image Classifiers in Java With Minimal ML Experience

    Preparing Data

    Navigate to the following URL to download the full normal eye dataset of 300 images.

    Use the following URL to download BinRushed.zip file containing all Glaucoma Images.

    Deep Dive Into Azure CustomVision.ai

    Navigate to CustomVision.ai and click on the New Project icon

    Image title

    Creating a New Project

    Create a new project by entering the mandatory details below.

    Image title

    Leave all radio buttons to default except for the domains where you choose the domain of relevance to your task. Else General (compact) should be good.

    Select Basic platforms under Export Capabilities, which uses a Tensorflow-based model.

    Image title

    You should now see the page below.

    Image title

    Adding New Tags

    Hit the + button next to Tags and add 2 new tags: Glaucoma-Eye and Normal-Eye, as shown below.

    Image title

    Uploading Images

    Upload all 300 images in the BinRushed4 dataset. Click on Add Images and select all files.

    Image title

    Click on MyTags textbox below and make sure that you click the Glaucoma-Eye tag before uploading all 357 files.

    Image title

    Image title

    Next, upload 200 images from the cataractdataset\dataset\1_normal folder. Click on Add Images, select 200 out of 300 files, select the Normal-Eye tag, and hit upload.

    Image title

    Training the Model

    Hit the green Train button at the top, select Quick Training, and click Train.

    Image title

    After the training is completed, you should be able to see the iteration details as below.

    Click the info icon next to Precision, Recall, and AP to understand these terms.

    Image title

    Image title

    Quick Test of the Model

    Hit the Quick Test button at the top and then “Browse Local Files.” Select any image from the folder cataractdataset\dataset\1_normal from 201 to 300 (which has not been part of the training set).

    Observe the Tag and Probability values for the image. It confirms that the Eye is normal.

    Image title

    Image title

    Image title

    Click “Browse Local Files” and select any Glaucoma positive images from BinRushed\BinRushed1.

    Observe Tag and Probability values. It confirms that the eye is Glaucoma Positive.

    Image title

    Image title

    Adding Cataract and Retina Disease Detection

    Next, add a new Tag called “Cataract Eye” and upload 90 images from cataractdataset\dataset\2_cataract. Hit the train button to retrain the model and observe the performance values change.

    Click on Quick Test and use one of the remaining 10 images in the untrained dataset to predict if it is a Cataract Eye or not.

    Image title

    Image title

    Image title

    Image title

    Image title

    Repeat all steps for Cataract Detection for Retina Disease and test with an eye image that is positive for Retina Disease as below.

    Image title

    Image title

    Image title

    Image title

    Image title


    Image title

    Image title

    Image title

    The Journey Forward

    Find as many images as possible on the web about Glaucoma, Cataract, Retina Disease, and Normal Eye as possible, upload them to the appropriate tags, and retrain the model.

    Try sliding the Probability Threshold bar on the Performance tab to check if you get more accurate predictions.

    Thanks for reading!

    Further Reading

    Getting Started With Azure Cognitive Services

    Various Uses of TensorFlow

    This UrIoTNews article is syndicated fromDzone

    0 0

    Number seven on a door

    7 Key Predictions for the Future of Voice Assistants and AI in 2020

    When voice technology began to emerge in 2011 with the introduction of Siri, no one could have predicted that this novelty would become a driver for tech innovation. Now nearly eight years later, it’s estimated that every 1 in 6 Americans own a smart speaker (Google Home, Amazon Echo) and eMarketer forecasts that nearly 100 million smartphone users will be using voice assistants in 2020. 

    Brands such as Amazon and Google are continuing to fuel this trend as they compete for market share. Voice interfaces are advancing at an exponential rate in industries of all kinds, ranging from healthcare to banking, as companies are racing to release their own voice technology integrations to keep pace with consumer demand.

    You might also like:  Top 10 Real-World Artificial Intelligence Applications

    What’s Causing the Shift Towards Voice?

    The main driver of the shift towards voice user interfaces is the changing user demands. There is an increased overall awareness and a higher level of comfort demonstrated specifically by millennial consumers. In this ever-evolving digital world where speed, efficiency, and convenience are constantly being optimized.

    The mass adoption of artificial intelligence in users’ everyday lives is also fueling the shift towards voice applications. The number of IoT devices such as smart thermostats, appliances, and speakers are giving voice assistants more utility in a connected user’s life. Smart speakers are the number one way we are seeing voice being used, however, it only starts there. Many industry experts even predict that nearly every application will integrate voice technology in some way in the next 5 years. 

    Applications of this technology are seen everywhere, so where will it take us in 2020 and beyond? We provide a high-level overview of the potential that voice has and 7 key predictions we think will take off in the coming years.

    7 Key Predictions for Voice in 2020

    Streamlined Conversations

    Both Google and Amazon recently announced that both assistants will no longer require the use of repeated “wake” words. Previously both assistants were dependent on a wake word (Alexa or Ok, Google) to initiate a new line of conversation. For example, one would have to ask, “Alexa, what’s the current temperature at the hallway thermostat?” and then have to say “Alexa” again before requesting that the voice assistant to “set the hallway thermostat to 23 degrees.” It would be more convenient and natural for the user to say, “Alexa, what’s the current temperature at the hallway thermostat?” and then simply say “set my hallway thermostat to 23 degrees,” without requiring the wake word again, and now that’s possible. 

    Consumers use voice assistants in specific locations, usually while multitasking, and can either be alone or amongst a group of people when using them. Having devices that can decipher these contextual factors make a conversation more convenient and efficient with these devices, but it also shows that developers behind the technology are aiming to provide a more user-centric experience.

    Compatibility and Integration

    When it comes to integrating voice technology with other products, Amazon has been ahead of the game. Those who use Alexa will be familiar with the fact that the voice assistant is already integrated into a vast array of products including Samsung’s Family Hub refrigerators. Google has finally caught on and has announced Google Assistant Connect. The idea behind this technology is for manufacturers to create custom devices that serve specific functions and are integrated with the Assistant.

    In 2020, we will see a greater interest in the development of voice-enabled devices. This will include an increase in mid-level devices: devices that have some assistant functionality but aren’t full-blown smart speakers. Instead, they communicate with your smart speaker, display or even perhaps your phone over Bluetooth where the processing happens on those devices. Amazon is already well on its way with an Alexa-enabled wall clock.

    Search Behaviors Will Change

    Voice search has been a hot topic of discussion. Visibility of voice will undoubtedly be a challenge. This is because the visual interface with voice assistants is missing. Users simply cannot see or touch a voice interface unless it is connected to the Alexa or Google Assistant app. Search behaviors, in turn, will see a big change. In fact, if tech research firm Juniper Research is correct, voice-based ad revenue could reach $19 billion by 2022, thanks in large part to the growth of voice search apps on mobile devices.

    Brands are now experiencing a shift in which touchpoints are transforming to listening points, and organic search will be the main way in which brands have visibility. comScore data even reveals that 50% of all search will be via voice tech by 2020. 

    As voice search grows in popularity, advertising agencies and marketers expect Google and Amazon will open their platforms to additional forms of paid messages.

    Individualized Experiences

    Voice assistants will also continue to offer more individualized experiences as they get better at differentiating between voices. Google Home is able to support up to six user accounts and detect unique voices, which allows Google Home users to customize many features. Users can ask “What’s on my calendar today?” or “tell me about my day?” and the assistant will dictate commute times, weather, and news information for individual users. It also includes features such as nicknames, work locations, payment information, and linked accounts such as Google Play, Spotify, and Netflix. Similarly, for those using Alexa, simply saying “learn my voice” will allow users to create separate voice profiles so the technology can detect who is speaking for more individualized experiences. 

    Voice Push Notifications

    We’ve previously discussed the method of using user-centric push notifications as a means to re-engage users with your app, voice technology presents a unique means of distributing push notifications. As a way to increase user engagement and retention, push notifications simply remind users of the app and display relevant messaging to the user. Now that both Google Assistant and Amazon’s Alexa allow the user to enable spoken notifications for any third-party app that has the compatibility, users can hear notifications rather than read them. These notifications are generally related to calendar appointments or new content from core features.  

    Touch Interaction

    CES 2019 continued to prove that voice and visual displays are merging into one seamless experience. This year Google showcased what is being called the E Ink screen. This display can show the weather, local traffic information, or calendar events. The push to bring visual and voice capabilities together allows users to further interact with the assistant.

    Security Will Be a Focus

    Forty-one percent of voice assistant users are concerned about trust and privacy according to a report from Microsoft. With news from Google I/O and Amazon’s re:MARS conferences announcing that assistants will essentially be able to plan an entire evening, for example, find local movie times, buy tickets, book a restaurant reservation and schedule an Uber, concerns regarding payments and sensitive information are valid. Voice payments, in particular, will become more secure and convenient for users to make purchases. Speaker verification and ID will also become paramount as part of the voice assistant experience with more security being built around the user.

    Why Adopt a Mobile Voice Strategy?

    Mobile phones are already personalized, more so than any website. Additionally, there is very little screen space on mobile, making it more difficult for users to search, or navigate. With larger product directories and more information, voice applications enable consumers to use natural language to eliminate or reduce manual effort, making it a lot faster to accomplish tasks. 

    Rogers has introduced voice commands to their remotes allowing customers to quickly browse and find their favorite shows or the latest movies with certain keywords, for example, an actor’s name. Brands need to focus on better mobile experiences for their consumers and voice is the way to do so. Users are searching for quicker and more efficient ways of accomplishing tasks and voice is quickly becoming the ideal channel for this. 

    Whether that’s finding out information, making a purchase, or achieving a task, voice is the new mobile experience. It’s clear that brands are racing to figure out their voice strategy. With over 100 million Alexa devices being sold alone, there’s a reason why businesses are looking to catch up.

    Voice User Interface (VUI) Will Continue to Advance

    Even with just that handful of simple scenarios, it’s easy to see why voice assistants are shaping up to become the hubs of our connected homes and increasingly connected lives.

    Voice technology is becoming increasingly accessible to developers. For example, Amazon offers Transcribe, an automatic speech recognition (ASR) service that enables developers to add speech-to-text capability to their applications. Once the voice capability is integrated into the application, users can analyze audio files and in return, receive a text file of the transcribed speech.

    Google has made moves in making Assistant more ubiquitous by opening the software development kit through Actions, which allows developers to build voice into their own products that support artificial intelligence. Another one of Google’s speech-recognition products is the AI-driven Cloud Speech-to-Text tool which enables developers to convert audio to text through deep learning neural network algorithms.

    This is only the beginning of voice technology as we will see major advancements in the user interface in the years to come. With the advancements in VUI, companies need to start educating themselves on how they can best leverage voice to better interact with their customers. It’s important to ask what the value of adding voice will be as it doesn’t always make sense for every brand to adopt. How can you provide value to your customers? How are you solving their pain points with voice? Will voice enhance the user experience or frustrate the user?

    In 2020, voice-enabled apps will not only accurately understand what we are saying, but how we are saying it and the context in which the inquiry is made.

    However, there are still a number of barriers that need to be overcome before voice applications will see mass adoption. Technological advances are making voice assistants more capable particularly in AI, natural language processing (NLP), and machine learning. To build a robust speech recognition experience, the artificial intelligence behind it has to become better at handling challenges such as accents and background noise. And as consumers are becoming increasingly more comfortable and reliant upon using voice to talk to their phones, cars, smart home devices, etc., voice technology will become a primary interface to the digital world and with it, expertise for voice interface design and voice app development will be in greater demand.

    Voice Is the Future of Brand Interaction and Customer Experience

    Advancements in a number of industries are helping digital voice assistants become more sophisticated and useful for everyday use. Voice has now established itself as the ultimate mobile experience. A lack of skills and knowledge make it particularly hard for companies to adopt a voice strategy. There is a lot of opportunity for much deeper and much more conversational experiences with customers. The question is, is your brand willing to jump on this opportunity?

    Further Reading

    2019: The Future of AI Technologies

    Alexa, Google Assistant, Siri: Voice as Future of Content Delivery

    This UrIoTNews article is syndicated fromDzone

    0 0

    The wrong way to approach AI development is to bolt it on and hope for the best, suggested Alex Muller of Synchrony Financial at AI World 2019 in Boston.

    Alex Muller is working on creating a consumer interface that aims to incorporate AI to learn about customers and deliver a continuously improving user experience. After selling his company, GPShopper, to Synchrony Financial in 2017, Muller is now Senior Vice President, Entrepreneur in Residence, Synchrony Financial, where he is leading this development effort.

    The team is working to define new roles and come up with an original development process.

    “Are you familiar with the waterfall development model?” he asked an audience at the AI World Conference & Expo held recently in Boston. “Don’t you know you’re not supposed to know that anymore?”

    Alex Muller, Senior Vice President, Entrepreneur in Residence, Synchrony Financial

    Waterfall was followed by agile development, noted for its “sprint” between project milestones. “But it was still too slow and it’s a one-size-fits-all approach,” he said. “The future of development is a self-evolving product,” he posited. “It’s evolving to be all things to all people.”

    There are wrong ways to approach AI development. “The wrong way to build AI is to bolt it on a hope for the best,” he said, showing an image of a rocket booster plugged into the back of a Volkswagen. “It won’t get you to California in five hours.”

    The product under development aims to take into account the context for the customer, the customer’s behavior, and the device in use. Instead of a Web page, a series of components are presented, each with some intelligence. “We can figure out what matters, so that instead of giving the user 12 decisions to make, we might make it five,” he said.

    It works by relying on underlying data, feeding into what he called “probabilistic components” that present a visual display based on contextual data.

    Job Titles on AI Development Team Evolving

    The key roles on the development team today, according to Muller, are:

    -Product Managers

    -UX Designers


    -QA Engineers


    Muller commented, “Historically, developers have not been data-oriented. The modern developer of the last five or 10 years, is object-oriented or functions-oriented.”

    One team member is assigned to connect the finished development product to the deployment infrastructure. “DevOps works to promote to production,” Muller said.

    Several new roles have recently been introduced to Muller’s Synchrony team:

    -Machine Learning Engineers

    -Sentiment Analysts

    -Supervised Learning Staff

    -AI Compliance

    Muller commented, “Machine learning engineers need not be data scientists. I am an engineer by training, not a scientist. I don’t need predictability to the 99th percentile. Muller has a BS in mechanical engineering from Tufts, a masters in environmental engineering from Carnegie Mellon and an MBA from Carnegie Mellon Tepper School of Business.

    In further comments, he said, “Supervised learning staff are the first set of people who are trained. What the staff trains on is what the user sees. The AI compliance I could talk about for an hour.”

    He offered some lessons learned from his new development efforts: “Teaching context is expensive,” he said. And, “Don’t centralize machine learning knowledge. I would rather have an ML engineer join our team. Also, “Stop trying to build everything; use tools that the PhD scientists built.” Also, “We believe in the citizen data scientist and ML engineers.”

    The new breed of “self-evolving” UI applications is coming, built on a solid foundation of data. “Set boundaries and allow your AI to evolve. Develop your AI talent across your organization.”

    Learn more at Synchrony Financial.

    This UrIoTNews article is syndicated fromAITrends

    0 0

    Industril machinery

    How Will AI Impact Machine Design?

    Artificial intelligence is a reality today. In most cases, we’re finding that robust and adaptive computing complements human expertise rather than replaces it outright. The task of engineering and designing new and more useful machines is one such case.

    Artificial intelligence and machine learning are changing how we design machines and products, making our industrial equipment more precise and efficient, and providing ways for engineers to optimize and automate their workflows. Here’s how.

    You might also like:

    Generative Design With AI

    One especially exciting application of AI in machine (and general product) design is generative design. This is where artificial intelligence designs new products according to a set of user-specified criteria or intelligently refines existing products for added stability, durability, or efficiency.

    A product designer could specify the maximum amount of raw material to be used in the final design or its minimum strength tolerances, for example. The algorithm then finds multiple efficient and workable designs that satisfy those criteria.

    Applications for generative design abound already, including in designing automotive body and engine parts for improved fuel efficiency extending service lifetimes. With generative design included in the workflow, one company used intelligent design to reduce the weight of an essential part while improving its heat-management properties.

    AI and the Circular Economy

    The worldwide AI market is expected to be worth $59 billion by the year 2025. A big reason for this growth is that significant parts of the economy are being rethought and restructured from top to bottom with leanness and intelligence at the core.

    Every industry has to become more energy-efficient, less wasteful of materials, and more cautious and economical about manufacturing new products. Customers demand these things, and so does the worldwide call for good environmental stewardship.

    This is at the heart of the “circular economy,” which McKinsey describes as one where “growth is gradually decoupled from the consumption of finite resources.” Their research found that achieving widespread adoption of circular economy principles in Europe could help the economy recover €1.8 trillion, or nearly $2 trillion, in value by 2030.

    With big data at its disposal, AI-led product and machine design can help companies realize significant financial and other benefits:

    • Big data allows companies to gather the insights their AI tools require to make smarter design iterations over time.

    • Incorporating user and aftermarket data sets in intelligent product design helps make industrial machines and sophisticated consumer-level goods more user-serviceable, longer-lasting, or easier to refurbish and resell. It means fewer electronics and other physical waste going to the landfill before its time.

    • Industrial equipment and enterprise planning platforms benefit from data gathered from vendors, customers, and the wider industry to make more strategic decisions about how to allocate assets and when and what to manufacture to meet demand.

    Self-Aware Industrial Machines

    Artificial intelligence makes self-monitoring machines a reality. The very means of production, like industrial conveyor belts, automated guided vehicles, and robotic arms and other implements, are being redesigned from the ground up with data collection and intelligence built right in.

    The lynchpin is the quality and affordability of modern sensors. Sensors are how production equipment and autonomous vehicles gather information and form a picture of what’s going on around them. This has enormous implications in improving the safety of industrial equipment and robots and the capabilities of robots.

    One of the most important involves turning machine vision to the task of inspecting parts for quality and safety.

    Another is that machine learning helps spot predictors of future failure better than humans can alone. Sensor data finds and flags things like temperature fluctuations, unusual vibrations, and the presence of contaminants at any time while a machine is in operation. This calls attention to maintenance items before they become equipment failures or product defects.

    Improved Cobots

    Along with sensor-driven self-aware manufacturing equipment, artificial intelligence also helps make cobots safer and more useful workers alongside their human counterparts.

    Improvements in artificial intelligence make it possible for robotic systems to work safely alongside humans in dangerous tasks while absorbing the majority of the physical risk. Welding heavy components are just one example — the welding industry is one expected to experience job shortages through and beyond 2022, making it a prime target for this technology.

    Deploying intelligent machines here is a way to shift existing talent into higher-complexity and higher-paying work, or safer but more delicate work, while  at a potentially impressive cost and material savings.

    This also applies to distribution and manufacturing facilities that require safe and efficient movement of heavy loads of materials or a high degree of accuracy in customer fulfillment. The race for patent-worthy designs for automated order pickers and stowing robots continues at full steam as well and shows what’s possible in warehousing and supply chain environments.

    Intelligently Designed Infrastructure

    Artificial intelligence is making both our physical infrastructure and the machines that built it more capable of “independent thought” in the design, build, and maintenance phases. The Netherlands is home to a more than 40-foot-long bridge that was designed using machine intelligence and, as the designers put it, “printed in midair” by self-directing 3D-printing robots.

    AI is not only an ally in the design of this bridge but also in the maintenance of it. The designers intend to incorporate sensors into the structure of the bridge to proactively monitor how it performs and how and whether its physical health fluctuates.

    Exciting Times Ahead

    These are exciting times for product designers, civil engineers, robotics specialists, machinists, and enterprise strategists alike.

    Artificial intelligence is already changing how we monitor the machines we rely on, dramatically boosting the self-awareness and efficiency of those machines, and helping us find new products and new solutions to talent shortages.

    Further Reading

    This UrIoTNews article is syndicated fromDzone

    0 0

    Fingerprint Biometric Authentication System

    Fingerprint Biometric Authentication System

    Biometrics Authentication Systems and artificial intelligence (AI) are among the most powerful weapons for fighting fraudsters in payment cards and the e-commerce industry. That was an important note from a recent presentation by MasterCard’s vice president for big data consulting.

    In his recent virtual presentation on “Unlock the Power of Data” at Dell Technologies, Nick offered an inside preview of how MasterCard uses machine learning and artificial intelligence combined with biometric technology to make card transactions smooth and frictionless with an end to end robust security.

    You might also enjoy:  Authentication and Authorization: Mastering Security

    However, it’s time to face the stark reality that criminals will soon gain access to AI, which could enable them to defeat multiple authentication systems from simple passwords to biometric security systems.

    Sounds a bit far-fetched. After all, AI is not easy to use, and it is difficult for everyone to gain access to AI tools. Unfortunately, with the amount of research already done on AI, we are entering an era where AI tools will be available everywhere from online shopping to your personal search experience and event to your home security system.

    Generative Adversarial Network: A Trailer of AI Threat

    AI tools might benefit humans, but they will also be used by fraudsters to carry out new kinds of attacks. One of the demos of AI-based attacks is the Generative Adversarial Network (GAN) algorithm. In a nutshell, GAN can imitate and simulate any distribution of data, including bio authentication data.

    To further elaborate on how GAN works, it involves competing for one neural network against another. One neural network, the generator, tries to simulate specific kinds of data and the second neural network, the discriminator, compares the generated data with the real one. It then informs the generator about the quality of simulated data. As this process progresses, both networks learn and get better at simulating and imitating data. The product of this consent between generator and discriminator is a large amount of fake data that is similar to the real one.

    A prominent example of GANs work is the creation of deep fakes. These deep fakes can defeat biometric sign-in systems. Deep fakes convincingly show people doing or showing things they have never said or done.

    Faking Fingerprints

    Thanks to GANs, it is possible to launch a brute-force fingerprint attack. Previously, brute-force attacks were used to make password guesses, but with the kind of fingerprint authentication systems used by banks, fingerprint security is not safe against fraudsters.

    Research conducted at the University of Michigan identified flaws in the current fingerprint security system that can easily be surpassed by GAN algorithm.

    Tackling Threats With AI Biometric Login

    However, the good news is that AI could be used to outsmart fraudsters by adding an extra layer of security to biometric authentication systems. Here are some ways the synergy between AI and Biometrics could be helpful.

    Finger Vein-Based Biometric Authentication Systems

    As we have discussed, biometric authentication systems could be fooled easily, but the finger-vein system that we are talking about is harder to be fooled. It only identifies unique finger-vein patterns beneath the skin of real humans. This technology uses CNN to identify unique patterns. Special capture machines that employ infrared light which passes through human skins and capture vein patterns that are unique to each user.

    3D Liveness Detection for Facial Recognition

    Facial Recognition is thought to be easily defeated by deep fakes. Some cases demonstrate how facial recognition technology could easily be fooled with deep fakes. To tackle the issue several tech giants are working on solving this issue. The companies like adobe, twitter, and NYT teams up to fight against deep fakes. Using 3D liveness detection based on deep neural networks, deep fakes could be defeated, said a tech expert at silicon valley.

    Staying Ahead of the Unknown

    AI-threats discussed here are the only ones identified by researchers. There are probably hundreds and thousands of ways AI can be used for cyberattacks that are yet to be considered. As we enter into a new world surrounded by AI, we need to stay ahead of this futuristic arms race of AI.

    If combined, AI and Biometrics technology could help in the identification of an individual based on their unique biological and behavioral traits, hence improving the security for the workplaces.

    Further Reading

    How Authentication Works in Encryption

    How to Enable Sign-in With iOS Biometric Authentication

    This UrIoTNews article is syndicated fromDzone

    0 0

    Woman in a laboratory

    AI Transformation in Medical Diagnoses

    Within every aspect of healthcare, time is considered the most valuable component. Even minutes of delay can result in the loss of life. Early diagnosis lies at the heart of healing patients, and timely execution of treatment is of primary importance. At an average, doctors spend 15 minutes with each patient, which when considered intently, is grossly insufficient in providing a comprehensive diagnosis of the illness. In an ideal situation, a diagnosis should be made after careful consideration of all relevant patient information, including similar cases and demographics.

    You might also lke:  Artificial Intelligence to Transform Healthcare as We Know It

    As the healthcare industry gradually moves toward an AI-driven world, things that were previously considered a hindrance or unlikely are now fairly simple tasks. Over the years, more than 90% of hospitals in the county have moved from paper-based systems to electronic processes. When it comes to medical diagnoses, patients’ records are of primary importance. Risks towards critical illnesses can be caught through predictive analysis, thereby saving lives and costs. Early diagnosis is no longer a distant hope, but an actuality that can be easily accomplished through advanced systems.

    What Is AI Transformation in Medical Diagnosis?

    In a nutshell, the adoption of technology that will assist the process of medical diagnoses through automation, prediction, etc. is referred to as AI transformation in medical diagnoses. Recently, many technology firms are looking to create systems that reduce the time between tests and treatments. This is done through automated and speedy mining of medical records with results of suggested treatments. Furthermore, there are predictive analytics platforms being developed, which uses machine learning to predict mortality.

    Within this technology, there are features that keep doctors in the loop with patient behavior, such as the patients that are likely to skip appointments and be irregular with their medication, their likelihood of readmission, risk of hospitalization, etc. AI technology also allows patients to easily reach out to doctors for notification of new symptoms. Through machine learning and advanced algorithms, conditions can be detected at a rate that was previously considered impossible.

    According to a 2016 study by Frost and Sullivan, AI in healthcare:

    • Targeted at reaching $6.6 billion by 2021
    • A 40% growth rate over the next 2 years
    • Medical imaging diagnosis is set to considerably improve
    • Medical outcomes improvement potential at 30% – 40%
    • Costs of treatment improvement potential at 50%

    How Important Is AI Transformation in Medical Diagnosis?

    Providing doctors and physicians with technology that allows them to tap into the collective knowledge of other doctors and millions of patient records is a luxury no healthcare organization would refuse. With the advanced systems out there, access to these records is fully automated (based on relevance) and is undertaken within seconds. The potential of such a technology cannot be undermined, and this is just one of the many features that AI brings to medical diagnosis. It is like a virtual personal assistant that offers doctors recommendations based on similar cases and the treatment provided.

    Although artificial intelligence doesn’t have the ability to replace doctors and physicians, it has the capability of mining data, performing analytics, and identifying patterns that are fairly impossible for humans to execute. When these technologies are used by skilled physicians and doctors, the medical diagnosis process is multiplied ten-fold quality-wise.

    Among the many advantages, the following stand out most distinctly:

    • Improved diagnosis
    • Reduced costs
    • Pattern identification
    • Clinically relevant, high quality and speedy data generation

    The Other Side of the Coin — Criticism of AI for Medical Diagnoses

    In spite of the many apparent advantages of AI for medical diagnoses, there are certain concerns that come to the forefront in the execution of these technologies. Below are some hindrances that have caused hesitations in the adoption of AI:

    1. The high costs involved in accessing superior quality data, developing models for intelligent analytics, pattern identification, training of algorithms, etc.
    2. Due to the scattered nature of the software, many healthcare agencies find that their models are incompatible with others. This causes more damage than good due to inefficient electronic medical record-keeping and a lack of comprehensiveness.
    3. Due to security reasons, many of the systems are kept away from the internet, making information sharing and access of data impossible. It defeats the entire purpose of electronic information since it is not easily accessible.
    4. Many medical practitioners are wary about these technologies since they view them as an encroachment into a doctor’s turf. The recommendations of these technologies might take doctors away from their instinctive diagnosis, which is their area of skill.

    According to Cisco, “While 54% of respondents to a recent survey of healthcare decision-makers about AI in healthcare expect widespread adoption of AI within the next five years, 36% see a lack of trust in AI among patients, and 30% among clinicians, as a barrier to adoption.”

    The Potentialities of AI in Medical Diagnoses

    Doctors and hospitals are increasingly leaning on intelligent systems and processes to identify patients who are at a risk for kidney failure, cardiac disorders, post-treatment infections, and hospital readmissions.

    Electronic health data, compounded by public database information, serves as a powerful resource towards diagnosis and suggested treatments. Medication suggestions are provided based on popularity among similar case histories, success rate is determined through patient outcome records, and a plethora of research can now be made available within seconds.

    Furthermore, certain medications are ineffective on certain people, and AI systems carry the potential of highlighting this to the doctor at the time of prescription. The analytical systems are also capable of catching anomalies in patient records. For example, if a patient claims that they don’t consume alcohol, but they display signs otherwise, the system can catch this and highlight it to the relevant doctor.

    According to Cisco, “A 2018 study in the Annals of Oncology compared a convolutional neural network (CNN), or machine learning (ML) system, with the determinations of 58 dermatologists. Using more than 100,000 images of malignant and benign tumors, the artificial intelligence (AI) system detected 95% of melanomas accurately, while human dermatologists found 86%.”

    To further comprehend the uses of AI, below is an industry-wise breakdown of the uses of AI in medical diagnosis:

    Through a concept called deep learning, these intelligent machines, use a wide range of sample data to form algorithms that are meaningful in their approach. The automated nature of these machines allows them to create an analysis that is impossible for the human brain to process, hence these machines work extremely efficiently to assist doctors and physicians.

    Are You Ready to Execute an AI Transformation Project? 10 Steps to Get You There

    Step 1

    The first step in the process is to familiarize the healthcare agency with the benefits and capabilities of AI. This will create a fair idea of the specific requirements of the agency and the relevance of AI for those specific needs.

    Step 2

    Once the agency has familiarized itself with the capabilities of AI, the next step is to identify the gaps of your personal organization. An analysis of the areas that need to be addressed will keep the focus on the problems that AI is intended to solve. The value of AI should be clearly visualized with respect to the specific needs of the healthcare agency.

    Step 3

    The next order of business is to focus on the business priorities and conduct an analysis that weighs the value of adopting AI with relation to the cost of implementation involved. Every investment should be directly tied to the business value it brings to the agency.

    Step 4

    Create provisions among the employees, nurses, and physicians to familiarize themselves with the available technology and participate in offering suggestions towards AI-adoption. Very often, they can point out to hindrances and advantages that may have been overlooked. This is because they are deeply involved in the everyday workings of the agency.

    Step 5

    Once the groundwork has been established, it is time to identify the developers that offer specific solutions and set up a pilot project. Establishing clear timelines for the pilot projects and the subsequent executions is crucial to success.

    Step 6

    Assign a small team of people that will periodically educate the healthcare agency on the systems being incorporated and the manners in which they can be used, along with the advantages they provide. Doing so in a periodic fashion allows the doctors and administrative staff to start using systems at close and regular intervals.

    Step 7

    Take gradual steps toward AI transformation rather than a complete revolution. This will assist the doctors, nurses and administrative staff to gradually adopt and familiarize themselves with changing systems. A sudden drastic transformation may seem overwhelming for the organization.

    Step 8

    Storage, whether it is of patient data or intelligent algorithms, is an important component of AI adoption. Every healthcare organization that is looking to make the move towards AI needs to make ample arrangements for storage requirements.

    Step 9

    Conduct periodic reviews with the developers that involve a display of the work in progress and the technologies already adopted. These reviews ensure that the AI being deployed is in line with the original agreement and providing the value that was originally envisioned.

    Step 10

    Maintain the balance between the developing AI systems and the capabilities of the technology. This will eliminate the risk of disappointments, wherein the agency later discovers that the technology is not living up to what it was intended for.

    Assisting Healthcare Agency to Conduct an AI Transformation of Legacy Systems

    Every healthcare organization needs to evaluate the need of their specific organization, in relation to its legacy system. There are different terms that are floating around, with regard to solutions for legacy systems and the ones heard most often are ‘migration’, ‘modernization’ and ‘transformation’. Let’s look at the difference between each of these:

    Migration: This is one of the simplest moves that a healthcare organization can make to their legacy system. It essentially involves moving the system from one platform to another, generally more effective. The functionality and design of the system remains the same and generally, the speed, cost, etc. is improvised.

    Modernization: This is one step ahead of migration and involves an enhancement of the capabilities and functions of the system. This does not involve moving the legacy system to a different platform and the capabilities are modernized and upgraded. The functionality is improvised.

    Transformation: This is a process that involves both migration and modernization. AI transformation involves a complete revamp of the legacy system, where a small component of the system is left behind at most. Platforms are changed and functionality and capabilities are enhanced.

    Conclusion — The Future of Medical Diagnoses

    The future looks very promising when it is viewed in line with the AI capabilities toward medical diagnoses. Whether it is machine learning, intelligent algorithms, automated data capabilities, or predictive analysis, there are several avenues of AI that can considerably boost the medical diagnosis process.

    Further Reading

    10 Best Frameworks and Libraries for AI

    Top 10 Real-World Artificial Intelligence Applications

    This UrIoTNews article is syndicated fromDzone

    0 0

    Fence locked up with chains

    Build an End-to-End Encrypted Chatbot

    As banking technology advances, secure real-time communication is becoming increasingly crucial to any modern banking application. It’s essential to provide the technology experiences customers expect while protecting their privacy and data.

    In this tutorial, we will walk through how to create a full, end-to-end encrypted chatbot solution using Stream Chat combined with Dialogflow using Virgil Security for encryption. Combining these services allows developers to create a modern chatbot experience while keeping sensitive information encrypted. The application embeds Virgil Security’s eThree Kit with Stream Chat React‘s components The react app communicates with a backend that uses Stream’s webhook integration and Dialogflow to respond to the user. All source code for this application is available on GitHub.

    You might also like:  How to Control Your Web App With an Integrated AI Chatbot

    What Is End-to-End Encryption?

    End-to-end encryption provides a method for securing messages between two individuals so that only those two users can read the message. To do this, the message is encrypted before it leaves a user’s device and can only be decrypted by the intended recipient.

    Virgil Security is a vendor that will enable us to create end-to-end encryption via public/private key technology. Virgil provides a platform and JavaScript SDK that will enable us to create, store, and offer robust end-to-end secure encryption.

    During this tutorial, we will create a Stream Chat app that uses Virgil’s encryption to prevent anyone except the intended parties from reading messages. No one in your company, nor any cloud provider you use, can read these messages. Even if a malicious person gained access to the database containing the messages, all they would see is encrypted text, called ciphertext.

    To build this application, we’re going to rely on a few libraries, Stream React Chat, Virgil SDK, Virgil Crypto, and Google Dialogflow. Our final product will encrypt text in the browser before sending a message to Stream Chat. The encrypted message will be relayed to our backend via Stream’s webhooks. Decryption and verification will happen on the backend before passing it to Dialogflow for interpretation. Once an intent has been determined, the backend performs any necessary actions, encrypts the response, and relays it via a Stream channel.

    Our chatbot will have 3 intents a user can perform, with 1 fallback in case we don’t understand what is said. These are a greeting, check balances, and transfer money between accounts. Once we’re done we’ll have a chatbot that’s capable of this:

    To accomplish this, the app performs the following process:

    • A user authenticates with your backend.
    • The user’s app requests a Stream auth token and api key from the backend. The browser creates a Stream Chat Client for that user.
    • The user’s app requests a Virgil auth token from the backend and registers with Virgil. This generates their private and public key. The private key is stored locally, and the public key is stored in Virgil.
    • The user joins a Stream Chat Channel with the chatbot.
    • The browser app asks Virgil for chatbot’s public key.
    • The user types a message and sends it to stream. Before sending, the app passes the chatbot’s public key to Virgil to encrypt the message. The message is relayed through Stream Chat to the backend via a webhook. Stream receives ciphertext, meaning they can never see the original message.
    • When the backend receives the message, the app decrypts the message using the Virgil. Virgil verifies the message is authentic by using the sender’s public key.
    • The backend passes the decrypted text to Dialogflow to determine the user’s intent. Dialogflow returns a result that contains the information necessary for the backend to decide how to respond.
    • The backend receives the Diagflow response, decides what action to take, and creates the response text.
    • Using Virgil, the backend encrypts the response text and responds to the user via the Stream Chat Channel. The client decrypts the message.

    This looks intimidating, but luckily Stream, Virgil, and Dialogflow do the heavy lifting for us. As a developer using these services, our responsibility is to wire them together correctly.

    The code is split between the React frontend contained in the frontend folder, and the Express (Node.js) backend is found in the backend folder. See the README.md in each folder to see installing and running instructions. If you’d like to follow along with running code, make sure you get both the backend and frontend running before continuing.

    Let’s walk through and look at the necessary code needed for each step.


    Basic knowledge of React and Node.js is required to follow this tutorial. This code is intended to run locally on your machine.

    You will need an account with Stream, Virgil, and Google Dialogflow. Dialogflow is a little tricky, so follow the instructions found in their nodejs library and how to authenticate with Google’s cloud APIs Once you’ve created your accounts, place your credentials in backend/.env. You can use backend/.env.example as a reference for what credentials are required.

    This tutorial uses the following package versions:

    • Node 11.14.0
    • Yarn 1.17.0
    • Stream Chat 0.13.3
    • Stream Chat React 0.6.26
    • Virgil Crypto 3.2.0
    • Virgil SDK 5.3.0
    • Virgil e3Kit 0.5.3
    • Dialogflow 0.12.2
    • Express 4.17.1

    Except for node and yarn, all of these dependencies are declared in backend/package.json and frontend/package.json.

    Step 1.1 Set up Dialogflow

    For our chatbot to respond correctly, we need to set up a few intents and one entity in our Dialogflow:

    If you’re set up correctly you should see these four intents in your Dialogflow console:

    Step 1.2 Set up Stream Webhooks

    For us to monitor and respond to a user’s chat message, we need to hook into Stream via webhooks. From your Stream dashboard, navigate to Chat -> Chat overview and look for the “Chat events” section. Switch the webhook to active and add the URL for your server. For local development, you can use a service like ngrok to make your localhost routable online. The path we’ll use is /v1/message to handle all Stream events. For convenience, we’ll turn off auth/permission checks. In a production environment, make sure you don’t bypass these and implement the necessary code to secure your Stream account. Your webhook should look like this with your, ngrok, or otherwise, URL instead of the ngrok URL.

    We’ll look at the implementation of /v1/message in Step 9.

    Step 2. Set up the Backend to Allow User to Get Credentials

    For our React frontend to interact with Stream and Virgil, the application provides three endpoints:

    • POST /v1/authenticate: This endpoint generates an auth token that allows the React frontend to communicate with /v1/stream-credentials and /v1/virgil-credentials. To keep things simple, this endpoint allows the client to be any user. The frontend tells the backend whom it wants to authenticate as. In your application, this should be replaced with your API’s authentication endpoint.
    • POST /v1/stream-credentials: This returns the data required for the React app to establish a session with Stream. In order return this info we need to tell Stream this user exists and ask them to create a valid auth token:
    // backend/src/controllers/v1/stream-credentials.js
    import { chat } from '../../stream'; exports.streamCredentials = async (req, res) => {
    try { const data = req.body; const user = Object.assign({}, data, { id: req.user.sender, role: 'user', image: `https://robohash.org/${req.user.sender}`, }); const token = chat.createToken(user.id); await chat.updateUsers([user]); res.status(200).json({ user, token, apiKey: process.env.STREAM_API_KEY });
    } catch (error) { console.log(error); res.status(500).json({ error: error.message });

    The response payload has this shape:

    { "apiKey": "<string>", "token": "<string>", "user": { "id": "<string>", "role": "<string>", "image": "<string>" }
    • apiKey is the stream account identifier for your Stream instance. Needed to identify what account your frontend is trying to connect with.
    • token JWT token to authorize the frontend with Stream.
    • user: This object contains the data that the frontend needs to connect and render the user’s view.
    // backend/src/virgil.js
    const virgilCrypto = new VirgilCrypto(); const generator = new JwtGenerator({
    appId: process.env.VIRGIL_APP_ID,
    apiKeyId: process.env.VIRGIL_KEY_ID,
    apiKey: virgilCrypto.importPrivateKey(process.env.VIRGIL_PRIVATE_KEY),
    accessTokenSigner: new VirgilAccessTokenSigner(virgilCrypto)
    }); exports.virgilToken = (user) => generator.generateToken(user); // backend/src/controllers/v1/virgil-credentials.js
    import { virgilToken } from '../../virgil'; exports.virgilCredentials = (req, res) => {
    const virgilJwtToken = virgilToken(req.user.sender); res.json({ token: virgilJwtToken.toString() });

    In this case, the front end only needs the auth token.

    Step 3. User Authenticates With the Backend

    Now that we have our backend set up and running, it is time to authenticate with the backend. If you’re running the application, you’ll be presented with a screen like so:

    This is a pure React form that takes the provided input, stores it in the state as sender, and uses that information to authenticate against the backend:

    // frontend/src/StartChat.js
    post("http://localhost:8080/v1/authenticate", { sender: this.state.sender }) .then(res => res.authToken) .then(this._connect);

    Once we have created a sender identity with an auth token, we can connect to Stream and Virgil.

    Step 4. User Connects to Stream

    Using the credentials from Step 3, we can request Stream credentials from the backend. Using those we connect our frontend client to Stream:

    // frontend/src/StartChat.js
    const response = await post("http://localhost:8080/v1/stream-credentials", {}, backendAuthToken); const client = new StreamChat(response.apiKey);
    client.setUser(response.user, response.token);

    This initializes the StreamChat object from the Stream Chat React library and authenticates a user using the token generated in the backend.

    Step 5. User Connects to Virgil

    Once again, using the credentials acquired in Step 3 we ask the backend to generate a Virgil auth token. Using this token, we initialize the EThree object from Virgil’s e3kit library:

    // frontend/src/StartChat.js
    const response = await post("http://localhost:8080/v1/virgil-credentials", {}, backendAuthToken);
    const eThree = await EThree.initialize(() => response.token);
    await eThree.register();

    Step 6. Create Stream Chat Channel

    Once we’re connected to both Stream and Virgil, we’re ready to start chatting with our chatbot. To do this, the client creates a channel between them and the chatbot.

    // frontend/src/StartChat.js
    const channel = this.state.stream.client.channel('team', `${this.state.sender}-chatbot`, { image: `https://getstream.io/random_svg/?id=rapid-recipe-0&name=${this.state.sender}`, name: this.state.sender, members: [this.state.sender, 'chatbot'],

    The client we’re accessing in the state is the one created in Step 4. Calling .channel will create or join a unique channel based on the identities of the members. Only the user and the chatbot will be allowed in. However, this is not enough to protect Stream or others from viewing those users’ messages. Next, we’ll use Virgil to encrypt the messages.

    Step 7. Lookup Virgil Public Keys

    To encrypt a message before sending it through a Stream channel, we need to look up the receiver’s public key:

    // frontend/src/StartChat.js
    const publicKeys = await this.state.virgil.eThree.lookupPublicKeys([this.state.sender, 'chatbot']);

    The eThree instance in our state is from Step 5. Assuming that the sender’s identity is will, this returns an object that looks like:

    { will: {/* Public Key Info */}, chatbot: {/* Public Key Info */}

    Since we need to decrypt our received messages for display and convenience, we ask for both public keys at the same time.

    Step 8. Sender Encrypts Message and Sends It via Stream

    We have everything we need to send a secure, end-to-end encrypted message via Stream. Time to chat! First, we need to show the user the chat room:

    // frontend/src/App.js
    <Chat client={this.state.stream.client} theme={'messaging light'}> <Channel channel={this.state.stream.channel}> <Window> <ChannelHeader/> <MessageList Message={this._buildMessageEncrypted}/> <MessageInputEncrypted virgil={this.state.virgil} channel={this.state.stream.channel}/> </Window> <Thread/> </Channel>

    This renders the Stream React Chat component that creates a great out-of-the-box experience for our users. If you’re following along you’ll see this:

    Notice the line where we include our custom class MessageInputEncrypted. This component uses the sender’s public key from Virgil to encrypt, then wrap, a Stream React MessageInput component before sending the message over the Stream channel:

    // frontend/src/MessageInputEncrypted.js
    export class MessageInputEncrypted extends PureComponent { sendMessageEncrypted = async (data) => { const encryptedText = await this.props.virgil.eThree.encrypt(data.text, this.props.virgil.publicKeys); await this.props.channel.sendMessage({ ...data, text: encryptedText }); }; render = () => { const newProps = { ...this.props, sendMessage: this.sendMessageEncrypted }; return <MessageInput {...newProps} /> }

    Now all Stream will see is the ciphertext!

    Step 9. The Backend Receives a Webhook from Stream, Sends It to Dialogflow and Responds

    Now we can react to the sender’s message on the backend, figure out the user’s intent via Dialogflow, perform an action if any, and respond. Since Stream sends us every even that happens for our account, we need first to decide if we should take action. We only want to do something when we have a message.new event from any user except for chatbot:

    // backend/src/controllers/v1/message.js
    exports.message = async (req, res) => { try { const data = req.body; const userId = data['user']['id']; if (data['type'] === 'message.new' && userId !== 'chatbot') { respondToUser(data); } res.status(200).json({}); } catch (error) { console.log(error); res.status(500).json({ error: error.message }); }

    Once we have decided this a message to respond to, we need to decrypt the message, interpret it, decide how to respond, encrypt the response, and send it via the chat channel.

    // backend/src/controllers/v1/message.js
    const respondToUser = async (data) => { const userId = data['user']['id']; const eThree = await getEThree(); const publicKey = await eThree.lookupPublicKeys(userId); const channel = chat.channel('team', `${userId}-chatbot`, {}); const result = await interpretMessage(eThree, publicKey, data); const response = await handleMessage(userId, result); const encryptedText = await eThree.encrypt(response, publicKey); const message = { text: encryptedText, user: { id: 'chatbot' }, }; await channel.sendMessage(message);

    To interpret the message, we use the Dialogflow setup configured in Step 1.1. We decrypt the user’s message and send the decrypted message to Dialogflow:

    // backend/src/controllers/v1/message.js
    const interpretMessage = async (eThree, publicKey, data) => { const userId = data['user']['id']; const message = await eThree.decrypt(data['message']['text'], publicKey); const sessionClient = new dialogflow.SessionsClient(); const sessionPath = sessionClient.sessionPath(process.env.GOOGLE_APPLICATION_PROJECT_ID, sessions[userId]); const responses = await sessionClient.detectIntent({ session: sessionPath, queryInput: { text: { text: message, languageCode: 'en-US', }, }, }); return responses[0].queryResult;

    Once we’ve interpreted the message, we can decide how to respond and what actions to take. In this simple app, we have two explicit actions we care about, “Check Accounts” and “Transfer Money”. Otherwise, we fallback to the fullfillmentText configured in Dialogflow. This will either be from the Default Welcome Intent or Default Fallback Intent intents.

    In the case of “Check Accounts”, we look up the user’s account balances and respond. For “Transfer Money”, we determine the direction, perform the balance transfer then respond:

    // backend/src/controllers/v1/message.js
    const handleMessage = (userId, result) => { let text = ''; if (result.intent.displayName === 'Check Accounts') { text = `Here are your balances\nChecking: $${balances[userId].checking}\nSavings: $${balances[userId].savings}`; } else if (result.intent.displayName === 'Transfer Money') { const parameters = struct.decode(result.parameters); const transfer = parameters.transfer; const amount = parameters.amount.amount; if (transfer === 'checking to savings') { balances[userId].checking -= amount; balances[userId].savings += amount; text = result.fulfillmentText; } else if (transfer === 'savings to checking') { balances[userId].checking += amount; balances[userId].savings -= amount; text = result.fulfillmentText; } else { text = 'Failed to transfer, unknown accounts'; } } else { text = result.fulfillmentText; } return text;

    That’s it for the server. 

    Step 10. Decrypt the Response Message on the Client

    Finally, we can display the servers. To decrypt the message, we follow a similar pattern to Step 8. If you look at how we create the MessageList you’ll see a custom Message component called MessageEncrypted:

    // frontend/src/App.js
    <MessageList Message={this._buildMessageEncrypted}/>

    Since we need to provide decryption props to add props for decryption to our custom Message component, we add them to the props passed by the Stream React:

    // frontend/src/App.js
    _buildMessageEncrypted = (props) => { const newProps = { ...props, sender: this.state.sender, receiver: this.state.receiver, virgil: this.state.virgil }; return <MessageEncrypted {...newProps}/>

    Once we have the props we need, we can decrypt each message:

    // frontend/src/MessageEncrypted.js
    export class MessageEncrypted extends PureComponent { _isMounted = false; constructor(props) { super(props); this.state = { decryptedText: null }; } componentDidMount = () => { this._isMounted = true; this._decryptText() .then( (decryptedText) => { if (this._isMounted) { this.setState({ decryptedText }); } } ); }; componentWillUnmount = () => { this._isMounted = false; }; _decryptText = async () => { const messageCreator = this.props.isMyMessage(this.props.message) ? this.props.sender : 'chatbot'; return this.props.virgil.eThree.decrypt( this.props.message.text, this.props.virgil.publicKeys[messageCreator] ); }; render = () => { const newProps = { ...this.props, message: { ...this.props.message, text: this.state.decryptedText || "" } }; return <MessageSimple {...newProps} /> }

    This class decrypts the message before rendering the MessageSimple component from Stream Chat React. To do this, we first determine if the message is our message with Stream’s .isMyMessage. We then find the correct public key and ask Virgil to decrypt it. Once that’s done, we can pass the key along with the rest of the props to the Stream’s MessageSimple component.

    The _isMounted flag prevents updating the component after the message has been decrypted. This can occur if you’re scrolling quickly, or upon page load when there are lots of messages.

    This tutorial is intended to get you up and running as fast as possible. Because of this, some critical functionality may be missing from your application. Here are some tips for what to do next with your app.

    • Configure a more in-depth chatbot experience. Dialogflow has a ton of functionality, such as , to build robust chatbot experiences.
    • Build real user registration and protect identity registration. This tutorial simplified registration and retrieving valid tokens to interact with Stream and Virgil.
    • Backup user’s private keys to restore sessions and for multiple devices. Using Virgil’s eThree.backupPrivateKey(pwd) will securely store the private key for restoration on any device.

    Further Reading

    4 Chatbot Security Measures You Absolutely Need to Consider

    Chatbots and Cybersecurity: New Security Vulnerabilities and Solutions

    This UrIoTNews article is syndicated fromDzone

    0 0

    Deep learning (DL) models are revolutionizing the business and technology world with jaw-dropping performances in one application area after another — image classification, object detection, object tracking, pose recognition, video analytics, synthetic picture generation — just to name a few.

    You may also be interested in:  Machine Learning vs Deep Learning

    However, they are like anything but classical machine learning (ML) algorithms/techniques. DL models use millions of parameters and create extremely complex and highly nonlinear internal representations of the images or datasets that are fed to these models.

    Whereas for the classical ML, domain experts and data scientists often have to write hand-crafted algorithms to extract and represent high-dimensional features from the raw data. Deep learning models, on the other hand, automatically extract and work on these complex features.

    Img Alt: Activations and Optimizers for Deep Learning | Deep Learning Flow | Exxact Inc

    Nonlinearity Through Activation

    A lot of theory and mathematical machines behind the classical ML (regression, support vector machines, etc.) were developed with linear models in mind. However, practical real-life problems are often nonlinear in nature and, therefore, cannot be effectively solved using those ML methods. 

    A simple illustration is shown below, and although it is somewhat over-simplified, it conveys the idea. Deep learning models are inherently better to tackle such nonlinear classification tasks.

    Img Alt: Activations and Optimizers for Deep Learning | Linear Vs NonLinear Problems | Exxact Inc

    However, at its core, a deep learning model consists of stacked layers of linear perceptron units and simple matrix multiplications are performed over them. Matrix operations are essentially linear multiplication and addition.

    So, how does a DL model introduce nonlinearity in its computation? The answer lies in the so-called “activation functions.”

    The activation function is the non-linear function that we apply over the output data coming out of a particular layer of neurons before it propagates as the input to the next layer. In the figure below, the function f denotes the activation.

    It can also be shown, mathematically, that the universal approximation power of a deep neural network — the ability to approximate any mathematical function to a sufficient degree — does not hold without these nonlinear activation stages in between the layers.

    Img Alt: Activations and Optimizers for Deep Learning | Approximation of Neural Network | Exxact Inc

    Image source

    There are various kinds and choices for the activation functions, and it has been found, empirically, that some of them work better for large datasets or particular problems than the others. We will discuss these in the next section.

    Reducing Errors With Optimizers

    Fundamentally, DL models fall in the class of supervised machine learning methods — techniques that extract the hidden pattern from a dataset by observing given examples of known answers.

    Evidently, it does so by comparing its predictions to the ground truth (labeled images for example) and turning the parameters of the model. The difference between the prediction and the ground truth is called the “classification error.”

    Parameters of a DL model consists of a set of weights connecting neurons across layers and bias terms which add to those layers. So, the ultimate goal is to set those weights to specific values, which reduces the overall classification error.

    Img Alt: Activations and Optimizers for Deep Learning | Training Set | Exxact Inc

    This is a minimization operation, mathematically. Consequently, an optimization technique is needed, and it sits at the core of a deep learning algorithm. We also know that the overall representation structure of the DL model is a highly complex nonlinear function and therefore, the optimizer is responsible for minimizing the error produced by the evaluation of this complex function. Therefore, standard optimization like linear programming does not work for DL models and innovative nonlinear optimization must be used.

    These two components — activation functions and nonlinear — are at the core of every deep learning architecture. However, there is considerable variety in the specifics of these components, and in the next two sections, we go over the latest developments.

    Img Alt: Activations and Optimizers for Deep Learning | Deep Learning Revolution | Exxact Inc

    The Gallery of Activation Functions

    The fundamental inspiration of the activation function as a thresholding gate comes from biological neurons’ behavior. 

    Img Alt: Activations and Optimizers for Deep Learning | Typical Neuron Structure| Exxact Inc

    The physical structure of a typical neuron consists of a cell body, an axon for sending messages to other neurons, and dendrites for receiving signals from other neurons. 

    The weight (strength) associated with a dendrite, called synaptic weights, gets multiplied by the incoming signal and is accumulated in the cell body. If the strength of the resulting signal is above a certain threshold, the neuron passes the message to the axon, else the signal dies off.

    In artificial neural networks, we extend this idea by shaping the outputs of neurons with activation functions. They push the output signal strength up or down in a nonlinear fashion depending on the magnitude. High magnitude signals propagate further and take part in shaping the final prediction of the network whereas the weakened signal dies off quickly.

    Some common activation functions are described below.

    Sigmoid (Logistic)

    The sigmoid function is a nonlinear function that takes a real-valued number as an input and compresses all its outputs to the range of [0,1. There are many functions with the characteristic of an “S” shaped curve known as sigmoid functions. The most commonly used function is the logistic function.

    Img Alt: Activations and Optimizers for Deep Learning | Sigmoid| Exxact Inc

    In the logistic function, a small change in the input only causes a small change in the output as opposed to the stepped output. Hence, the output is smoother than the step function output.

    Img Alt: Activations and Optimizers for Deep Learning | Logistic Function | Exxact Inc

    While sigmoid functions were one of the first ones used in early neural network research, they have fallen in favor recently. Other functions have been shown to produce the same performance with fewer iterations. However, the idea is still quite useful for the last layer of a DL architecture (either as stand-alone or as a softmax function) for classification tasks. This is because of the output range of [0,1] which can be interpreted as probability values.

    Tanh (Hyperbolic Tangent)

    Tanh is a non-linear activation function that compresses all its inputs to the range [-1, 1]. The mathematical representation is given below,

    Img Alt: Activations and Optimizers for Deep Learning | Activation Function | Exxact Inc

    Tanh is similar to the logistic function, it saturates at large positive or large negative values, the gradient still vanishes at saturation. But Tanh function is zero-centered so that the gradients are not restricted to move in certain directions.

    Img Alt: Activations and Optimizers for Deep Learning | Tanh Function | Exxact Inc

    ReLU (Rectified Linear Unit)

    ReLU is a non-linear activation function that was first popularized in the context of a convolution neural network (CNN). If the input is positive then the function would output the value itself, if the input is negative the output would be zero.

    Img Alt: Activations and Optimizers for Deep Learning | Rectified Linear Unit | Exxact Inc

    The function doesn’t saturate in the positive region, thereby avoiding the vanishing gradient problem to a large extent. Furthermore, the process of ReLu function evaluation is computationally efficient as it does not involve computing exp(x) and therefore, in practice, it converges much faster than logistic/Tanh for the same performance (classification accuracy for example). For this reason, ReLU has become de-facto standard for large convolutional neural network architectures such as Inception, ResNet, MobileNet, VGGNet, etc.

    However, despite its critical advantages, ReLU sometimes can give rise to dead neuron problems as it zeroes the output for any negative input. This can lead to reduced learning updates for a large portion of a neural network. To avoid facing this issue, we can use the so-called ‘leaky ReLU’ approach.

    Leaky ReLU

    In this variant of ReLU, instead of producing zero for negative inputs, it will just produce a very small value proportional to the input i.e 0.01x, as if the function is ‘leaking’ some value in the negative region instead of producing hard zero values.

    Img Alt: Activations and Optimizers for Deep Learning | Leaky Function | Exxact Inc

    Because of the small value (0.1) proportional to the input for the negative values, the gradient would not saturate. If the input is negative, gradient would be 0.01 times the input, this ensures neurons don’t die. So, the apparent advantages of Leaky ReLU are that it doesn’t saturate in the positive or negative region, it avoids “dead neurons” problem, it is easy to compute, and it produces close to zero-centered outputs.

    Img Alt: Activations and Optimizers for Deep Learning | Leaky ReLU | Exxact Inc

    Swish: A Recent Development

    Although you are more likely to come across one of the aforementioned activation functions, in dealing with common DL architectures, it is good to know about some recent developments where researchers have proposed alternative activation functions to speed up large model training and hyperparameter optimization tasks.

    Swish is such a function, proposed by the famous Google Brain team (in a paper where they searched for optimum activation function using complex reinforcement learning techniques).

     f(x) =x.sigmoid(x)

    Img Alt: Activations and Optimizers for Deep Learning | Swish Function | Exxact Inc

    Google team’s experiments show that Swish tends to work better than ReLU on deeper models across a number of challenging data sets. For example, simply replacing ReLUs with Swish units improves top-1 classification accuracy on ImageNet by 0.9% for Mobile NASNetA and 0.6% for Inception-ResNet-v2. The simplicity of Swish and its similarity to ReLU makes it easy for practitioners to replace ReLUs with Swish units in any neural network.

    Optimization Techniques for Deep Learning

    As stated earlier, a deep learning model works by gradually reducing the prediction error with respect to a training dataset by adjusting the weights of the connections.

    But how does it do this automatically? The answer lies in the technique called — backpropagation with gradient descent.

    Gradient Descent

    The idea is to construct a cost function (or loss function) which measures the difference between the actual output and predicted output from the model. Then gradients of this cost function, with respect to the model weights, are computed and propagated back layer by layer. This way, the model knows the weights, responsible for creating a larger error, and tunes them accordingly.

     Img Alt: Activations and Optimizers for Deep Learning | Gradient Descent | Exxact Inc

    Image source

    The cost function of a deep learning model is a complex high-dimensional nonlinear function that can be thought of as uneven terrain with ups and downs. Somehow, we want to reach the bottom of the valley i.e. minimize the cost. Gradient indicates the direction of increase. As we want to find the minimum point in the valley we need to go in the opposite direction of the gradient. We update parameters in the negative gradient direction to minimize the loss.

    But how much to update at each step? That depends on the learning rate.

    Learning Rate

    Learning rate controls how much we should adjust the weights with respect to the loss gradient. Learning rates are randomly initialized. Lower the value of the learning rate, slower will be the convergence to global minima. A higher value for learning rate will not allow the gradient descent to converge.

    Basically, the update equation for weight optimization is,

    Img Alt: Activations and Optimizers for Deep Learning | Learning Rate Equation | Exxact Inc

    Here, α is the learning rate, C is the cost function and w and ω are the weight vectors. We update the weights proportional to the negative of the gradient (scaled by the learning rate).

    Stochastic and Mini-Batch Gradient Descent

    There are a few variations of the core gradient descent algorithm:

    • Batch gradient descent
    • Stochastic gradient descent
    • Mini-batch gradient descent

    In batch gradient, we use the entire dataset to compute the gradient of the cost function for each iteration of the gradient descent and then update the weights. Since we use the entire dataset to compute the gradient at one shot, the convergence is slow. If the dataset is huge and contains millions or billions of data points then it is memory as well as computationally intensive as it involves the matrix (with billions of rows and columns) inversion and multiplication steps.

    Stochastic gradient descent uses a single datapoint (randomly chosen) to calculate the gradient and update the weights with every iteration. The dataset is shuffled to make it randomized. As the dataset is randomized and weights are updated for every single example, the cost function and weight update are generally noisy.

    Mini-batch gradient is a variation of stochastic gradient descent where instead of a single training example, a mini-batch of samples is used. Mini batch gradient descent is widely used and converges faster and is more stable. Batch size can vary depending on the dataset and generally are 128 or 256. The data per batch easily fits in the memory, the process is computationally efficient, and it benefits from vectorization. If the search (for minima) is stuck in a local minimum point, some noisy random steps can take them out of it.

    Momentum Technique

    The idea is momentum is borrowed from simple physics, where it can be thought of as a property of matter which maintains the inertial state of an object rolling downhill. Under gravity, the object gains momentum (increases speed) as it rolls further down.

    For gradient descent, Momentum helps accelerate the process when it finds surfaces that curve more steeply in one direction than in another direction and dampens the speed suitably. This prevents overshooting a good minima while trying to gradually improve the speed of convergence.

    It accomplishes this by keeping track of a history of gradients along the way and using past gradients to determine the shape of the movement of the current search.

    Img Alt: Activations and Optimizers for Deep Learning | Stochastic Gradient | Exxact Inc

    Nesterov Accelerated Gradient (NAG)

    This is an enhanced Momentum-based technique where the future gradients are computed ahead of the time (based on some look-ahead logic) and that information is used to help speed up the convergence as well as slowing down the update rate as necessary.

    Here is a detailed article on various sub-types and formulations of NAG.

    Img Alt: Activations and Optimizers for Deep Learning | Nesterov Accelerated Gradient | Exxact Inc

    AdaGrad Optimizer

    Many times, the dataset exhibits sparsity and some parameters need to be updated more frequently than others. This can be done by tuning the learning rate differently for different sets of parameters and AdaGrad does precisely that.

    AdaGrad performs larger updates for infrequent parameters and smaller updates for frequent parameters. It is well suited when we have sparse data as in large scale neural networks. For example, GloVe word embedding (an essential encoding scheme for Natural Language Processing or NLP tasks) uses AdaGrad where infrequent words required a greater update and frequent words require smaller updates.

    Below we show the update equation for AdaGrad wherein the denominator, all the past gradients are accumulated (sum of squares term).

    Img Alt: Activations and Optimizers for Deep Learning | AdaGrad Optimizer | Exxact Inc

    AdaDelta Optimizer

    The denominator term in the AdaGrad keeps on accumulating the previous gradients and therefore can make the effective learning rate close to zero after some time. This will make the learning ineffective for the neural network. AdaDelta tries to address this monotonically decreasing tuning of the learning rate by restricting the accumulation of past gradients within some fixed window by calculating a running average.

    Img Alt: Activations and Optimizers for Deep Learning | AdaDelta Optimizer | Exxact Inc


    RMSProp tries to address the issue of Adagrad’s rapidly diminishing learning rate by using a moving average of the squared gradients. It utilizes the magnitude of the recent gradient descents to normalize the gradient. Effectively, this algorithm divides the learning rate by the average of the exponential decay of squared gradients.

    Img Alt: Activations and Optimizers for Deep Learning | RMSProp | Exxact Inc

    Summary of Activations and Optimizers for Deep Learning

    In this article, we went over two core components of a deep learning model — activation function and optimizer algorithm. The power of deep learning to learn highly complex patterns from huge datasets stems largely from these components as they help the model learn nonlinear features in a fast and efficient manner.

    Both of these are areas of active research and new developments are happening to enable training of ever-larger models and faster but stable optimization processes while learning over multiple epochs using terabytes of data sets.

    This UrIoTNews article is syndicated fromDzone

    0 0

    Man with dirt on his hands

    Getting Your Hands Dirty With TensorFlow 2.0 and Keras API

    TensorFlow 2.0 comes with Keras packaged inside, so there is no need to import Keras as a separate module (although you can do this if you need). The TensorFlow 2.0 API is simplified and improved. This is good news for us machine learning developers.

    This is how you import Keras from TensorFlow:

    from tensorflow import feature_column
    from tensorflow import keras
    from tensorflow.keras import layers

    I’m using the tf.data input pipeline to encode categorical columns. The Keras API works well with tf.data. One of the main advantages of tf.data is the fact that it acts as a bridge between the data and model. There is no need to transform data by yourself — transformed data will automatically be applied during training.

    Data is fetched from CSV file into Pandas dataframe:

    column_names = ['report_id','report_params','day_part','exec_time']
    raw_dataframe = pd.read_csv('report_exec_times.csv')
    dataframe = raw_dataframe.copy()

    Column values for report_params vary, and we need to normalize this column (make values to be on a similar scale):

    eps=0.001 # 0 => 0.1¢
    dataframe['report_params'] = np.log(dataframe.pop('report_params')+eps)

    I’m using a utility method (this method is taken from TensorFlow tutorial) to create tf.data dataset from Pandas dataframe:

    def df_to_dataset(dataframe, shuffle=True, batch_size=32): dataframe = dataframe.copy() labels = dataframe.pop('exec_time') ds = tf.data.Dataset.from_tensor_slices((dict(dataframe), labels)) if shuffle: ds = ds.shuffle(buffer_size=len(dataframe)) ds = ds.batch(batch_size) return ds

    Next, we need to define data mapping for categorical columns encoding. I’m using the TensorFlow vocabulary list function, including mapping for all unique values (if there are many values, it would be better to use embedding API). Two columns are encoded: report_id and day_part:

    feature_columns = []
    report_id = feature_column.categorical_column_with_vocabulary_list('report_id', ['1', '2', '3', '4', '5'])
    report_id_one_hot = feature_column.indicator_column(report_id)
    day_part = feature_column.categorical_column_with_vocabulary_list('day_part', ['1', '2', '3'])
    day_part_one_hot = feature_column.indicator_column(day_part)

    Create Keras dense features layer out of array with TensorFlow encodings. We will use this layer during Keras model construction to define model training features:

    feature_layer = tf.keras.layers.DenseFeatures(feature_columns)

    We are done with features. Next, convert Pandas dataframe to tf.data with the help of the utility function:

    batch_size = 32
    train_ds = df_to_dataset(train, batch_size=batch_size)
    val_ds = df_to_dataset(val, shuffle=False, batch_size=batch_size)
    test_ds = df_to_dataset(test, shuffle=False, batch_size=batch_size)

    Dense features layer is used when the Keras sequential model is defined (there is no need to pass an array of features later into a fit function):

    def build_model(feature_layer): model = keras.Sequential([ feature_layer, layers.Dense(16, activation='relu'), layers.Dense(16, activation='relu'), layers.Dense(1) ]) optimizer = keras.optimizers.RMSprop(0.001) model.compile(loss='mse', optimizer=optimizer, metrics=['mae', 'mse']) return model

    Training is executed through the model.fit function. We are using tf.data input pipeline to pass training and validation sets:

    history = model.fit(train_ds, validation_data=val_ds, epochs=EPOCHS, callbacks=[early_stop])

    The awesome thing about it is that data encoding happens behind the scenes based on the rules defined for the feature layer.

    How do we run the model.predict function with tf.data and feature layer? It’s simple.

    Construct Pandas dataframe with input data:

    headers = ['report_id', 'report_params', 'day_part']
    dataframe_input = pd.DataFrame([[1, 15, 3]], columns=headers, dtype=float, index=['input'])

    Convert report_params value to be on the same scale as it was for the training:

    eps=0.001 # 0 => 0.1¢
    dataframe_input['report_params'] = np.log(dataframe_input.pop('report_params')+eps)

    Create tf.data input pipeline out of Pandas dataframe:

    input_ds = tf.data.Dataset.from_tensor_slices(dict(dataframe_input))
    input_ds = input_ds.batch(1)

    Run model.predict function:

    res = model.predict(input_ds)


    • Source code with sample data is available on my GitHub repo


    Further Reading

    This UrIoTNews article is syndicated fromDzone