Getting Started With AI In MATLAB

Transcription

Getting started with AI in MATLABDr Julia HoernerAmith KamathAI Academic Liaison Manager/ EuropeAI Academic Liaison Manager/ s.com1

In this workshop we will Learn the Fundamentalsof AILearn the Fundamentalsof Deep LearningLearn the Fundamentalsof Machine LearningUse real-world ECG SignalsDiscussdeploymentoptions2

Set-Up Instructions Set up a MathWorks account if you don’t have one – please use Google Chrome browser– go to https://www.mathworks.com/mwaccount/ Copy the materials via the MATLAB Drive– go to e-bc94-9db1d5195e77– Click on Add to my Files/Copy Folder– You should see a separate folder saying “Owned By: Me” (on the right-hand side) Activate the workshop license and launch MATLAB Online – go to MATLAB EXPO 8726324/– click Access MATLAB Online– log in using your MathWorks account3

AI in Research and IndustryUniversity of Twente: Augmented Reality ofblood flowAutomatic DefectDetectionOversteeringDetectionDKFZ Heidelberg: Deep Learning for TumorDetectionSeismic EventDetection4

MathWorks Focus on Deep Learning and AI for Engineering andSciencePredictive Maintenance Bearing Prognosis Pump Fault DiagnosisLand-Use Classification Semantic Segmentation forMultispectral ImagesLidar Lidar Point Cloud Semantic Segmentation 3-D Object Detection Using PointPillarsRadar Radar Waveform Classification Pedestrian and Bicyclist ClassificationWireless Communications Modulation Classification Detect WLAN Router ImpersonationReinforcement Learning Train Biped Robot to Walk PMSM Motor ControlPredictive MaintenanceToolbox Image ProcessingToolbox LidarToolbox Phased ArraySystem Toolbox Computational Finance Machine Learning forStatistical ArbitrageRobotics Avoid Obstacles usingReinforcement LearningAutomated Driving Deep Learning Vehicle Detector Occupancy Grid with Semantic SegmentationVisual Inspection Manufacturing Defect Detection Anomaly Detection for Cloth ManufacturingFinancialToolbox Robotics SystemToolbox AutomatedDriving Toolbox Image ProcessingToolbox AudioCommunicationsToolbox ReinforcementLearning Toolbox Speech Command Recognition Cocktail Party Source SeparationAudioToolbox Medical Imaging 3-D Brain Tumor Segmentation Breast Cancer Tumor ClassificationImage ProcessingToolbox 5

What is AI?Artificial Intelligence: The ability of a computer to perform taskscommonly associated with intelligent beings like learning or problem-solving.Machine Learning: Learning a task from data without relying on apredetermined equation. (User may need to provide data features.)Deep Learning: Learning from raw data withoutpredetermined features using neural networks with many layers1950s20156

Types of Machine LearningType of LearningCategories of chineLearningDevelop predictivemodel based on bothinput and output dataUnsupervisedLearningEasy and accurate computation of dayahead system load forecastClassificationClusteringDiscover an internalrepresentation frominput data only7

Types of Machine LearningType of LearningCategories of chineLearningDevelop predictivemodel based on bothinput and output dataClassificationTrain a classifier to classify humanactivity from sensor dataData:Inputs3-axial Accelerometer3-axial over an internalrepresentation frominput data only8

Types of Machine LearningType of LearningCategories of chineLearningDevelop predictivemodel based on bothinput and output dataUnsupervisedLearningGiven data for engine speed andvehicle speed, identify clustersClassificationClusteringDiscover an internalrepresentation frominput data only9

Types of Machine LearningType of LearningCategories of AlgorithmsExamples of ssificationLinearRegression,GLMSVR, chineLearningUnsupervisedLearningDeep LearningReinforcementLearning10

Machine Learning and Deep Learning DatatypesImageSignalNumericText11

AI WorkflowData PreparationAI ModelingDeploymentData cleansing andpreparationModel design andtuningIntegration withcomplex systemsEmbedded devicesHuman insightHardwareaccelerated trainingSystem simulationEnterprise systemsSimulationgenerated dataInteroperabilitySystem verificationand validationEdge, cloud,desktopI12Simulation & TestIteration and Refinement12

Practical Example: Classify Heart ConditionNormalECG Data*ModelAbnormalECG characteristics (for ML):*Dataset was curated for 2017 PhysioNet challenge: "normal" ECG data was obtained from theMIT-BIH Normal Sinus Rhythm database available at https://physionet.org/content/nsrdb/1.0.0/, and“abnormal” from MIT-BIH Arrythmia database at https://www.physionet.org/content/mitdb/1.0.0/ECG transformation (for DL):13

ML Exercise: Classify Heart ConditionGoal: classify heartbeat signal into normal andabnormal using machine learningTo Do:– Go to Exercises folder– Open Ex1 ECG ML FeaturesStats.mlx and follow along withthe instructor14

Beyond traditional Machine LearningMachine LearningMachine LearningDeep LearningNeural Networkswith many HiddenLayersDeep Learning Learns directly from dataMore Data better modelComputationally intensiveNot interpretable15

What is Deep Learning? DL uses neural networks and was inspired by thehuman brainDL neural networks consist of–––– Neurons arranged in layersLayer combinationsLearnable parameters (weights and biases)Hyperparameters (e.g. learning rate, number of epochs,mini batch size, etc.)Most commonly, DL is used for:– Classification: Output is categorical (or discrete)– Regression: Output is numerical (or continuous)– (Can also be used to generate things, e.g. GANs)16

What is Deep Learning? Layers are like blocks– Stack on top of each other– Replace one block with a different one Information is usually passed in a forward pass (butcan also be passed backwards)Weights and biases are adjusted in a backward pass(backpropagation) using a gradient descentThere are different networks for different applications(e.g. CNNs for images, RNNs for sequential data)17

Signal Processing ArchitecturesFeature EngineeringRecurrent Neural Network (RNN)(e.g. Long Short-Term Memory (LSTM) Networks)SpectrogramORConvolutional Neural Networks (CNN)Time-Frequency Transformation18

Quick overview of Convolution Neural Networks CNNs are typically used to classify imagesCNNs extract features of different granularitiesA lot of pretrained CNN models exist in MATLABA very good starting point to use with transfer learning19

DL Exercise: Classify Heart ConditionGoal: classify heartbeat signal into normal andabnormal using deep learningTo Do:– Go to Exercises folder– Open Ex2 ECG DL CNN.mlx and follow along with theinstructorThe example using LSTM can be found here.20

AI WorkflowData PreparationAI ModelingDeploymentData cleansing andpreparationModel design andtuningIntegration withcomplex systemsEmbedded devicesHuman insightHardwareaccelerated trainingSystem simulationEnterprise systemsSimulationgenerated dataInteroperabilitySystem verificationand validationEdge, cloud,desktopI21Simulation & TestIteration and Refinement21

AI WorkflowSignal Labeler Audio LabelerExperimentManagerEXPO talks:Deploying AI on PLC (Plenary)Image Labeler Video LabelerONNXCloud Data Workflows for Scientistsand Engineers (DataBricks & AWS)22

Biggest Challenge: Use Machine or Deep Learning?23

Resources for Learning Get Free Online (hands-on) Training24

Resources for Teaching Teach with MATLAB and Simulink Teaching Science with MATLAB Virtual Labs & Projects Online teaching Support with developing individual AI courses,please contact us:jhoerner@mathworks.com orakamath@mathworks.com25

Thank you 2021 The MathWorks, Inc. MATLAB and Simulink are registered trademarks of The MathWorks, Inc. See mathworks.com/trademarksfor a list of additional trademarks. Other product or brand names may be trademarks or registered trademarks of their respective holders.26

Getting started with AI in MATLAB Amith Kamath AI Academic Liaison Manager/ Asia-Pacific akamath@mathworks.com. 2 In this workshop we will Use real-world ECG Signals Learn the Fundamentals of AI Lea