Skip to content

Commit

Permalink
Merge pull request #415 from harvard-edge/new-figures
Browse files Browse the repository at this point in the history
First 9 chapters in correct format
  • Loading branch information
profvjreddi authored Sep 17, 2024
2 parents 4504832 + 28781e5 commit 4b9b5bf
Show file tree
Hide file tree
Showing 16 changed files with 1,599 additions and 89 deletions.
6 changes: 3 additions & 3 deletions contents/ai_for_good/ai_for_good.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ What is special about the SDGs is that they are a collection of interlinked obje

A recent study [@vinuesa2020role] highlights the influence of AI on all aspects of sustainable development, particularly on the 17 Sustainable Development Goals (SDGs) and 169 targets internationally defined in the 2030 Agenda for Sustainable Development. The study shows that AI can act as an enabler for 134 targets through technological improvements, but it also highlights the challenges of AI on some targets. The study shows that AI can benefit 67 targets when considering AI and societal outcomes. Still, it also warns about the issues related to the implementation of AI in countries with different cultural values and wealth.

![United Nations Sustainable Development Goals (SDG). Source: [United Nations](https://sdgs.un.org/goals).](https://www.un.org/sustainabledevelopment/wp-content/uploads/2015/12/english_SDG_17goals_poster_all_languages_with_UN_emblem_1.png){#fig-sdg}
![United Nations Sustainable Development Goals (SDG). Source: [United Nations](https://sdgs.un.org/goals).](https://www.un.org/sustainabledevelopment/wp-content/uploads/2015/12/english_SDG_17goals_poster_all_languages_with_UN_emblem_1.png){#fig-fig-sdg}

In our book's context, TinyML could help advance at least some of these SDG goals.

Expand Down Expand Up @@ -68,15 +68,15 @@ Other sensors, such as GPS units and accelerometers, can track microclimate cond

Widespread TinyML applications can help digitize smallholder farms to increase productivity, incomes, and resilience. The low cost of hardware and minimal connectivity requirements make solutions accessible. Projects across the developing world have shown the benefits:

* Microsoft's [FarmBeats](https://www.microsoft.com/en-us/research/project/farmbeats-iot-agriculture/) project is an end-to-end approach to enable data-driven farming by using low-cost sensors, drones, and vision and machine learning algorithms. The project seeks to solve the problem of limited adoption of technology in farming due to the need for more power and internet connectivity in farms and the farmers' limited technology savviness. The project strives to increase farm productivity and reduce costs by coupling data with farmers' knowledge and intuition about their farms. The project has successfully enabled actionable insights from data by building artificial intelligence (AI) or machine learning (ML) models based on fused data sets. @farmbeats illustrates the inner workings of Microsoft's FarmBeats.
* Microsoft's [FarmBeats](https://www.microsoft.com/en-us/research/project/farmbeats-iot-agriculture/) project is an end-to-end approach to enable data-driven farming by using low-cost sensors, drones, and vision and machine learning algorithms. The project seeks to solve the problem of limited adoption of technology in farming due to the need for more power and internet connectivity in farms and the farmers' limited technology savviness. The project strives to increase farm productivity and reduce costs by coupling data with farmers' knowledge and intuition about their farms. The project has successfully enabled actionable insights from data by building artificial intelligence (AI) or machine learning (ML) models based on fused data sets. @fig-farmbeats illustrates the inner workings of Microsoft's FarmBeats.

* In Sub-Saharan Africa, off-the-shelf cameras and edge AI have cut cassava disease losses from 40% to 5%, protecting a staple crop [@ramcharan2017deep].

* In Indonesia, sensors monitor microclimates across rice paddies, optimizing water usage even with erratic rains [@tirtalistyani2022indonesia].

With greater investment and integration into rural advisory services, TinyML could transform small-scale agriculture and improve farmers' livelihoods worldwide. The technology effectively brings the benefits of precision agriculture to disconnected regions most in need.

![Microsoft Farmbeats.](contents/ai_for_good/images/png/msfarmbeats.png){#farmbeats}
![Microsoft Farmbeats enables data-driven decisions to improve agricultural yield, lower overall costs, and reduce the environmental impact of agricultural production. Source: [MOLD](https://thisismold.com/space/farm-systems/does-farmbeats-really-march-to-a-different-tune)](images/png/msfarmbeats.png){#fig-farmbeats}

:::{#exr-agri .callout-caution collapse="true"}

Expand Down
6 changes: 2 additions & 4 deletions contents/benchmarking/benchmarking.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,6 @@ Benchmarking the training phase provides insights into how different model archi

On the other hand, benchmarking inference evaluates model performance in real-world conditions after deployment. Key metrics include latency, throughput, memory footprint, and power consumption. This type of benchmarking determines if a model meets the requirements of its target application regarding response time and device constraints. However, we will discuss these broadly to ensure a general understanding.

![Deep learning: training vs. inference.](contents/benchmarking/images/png/trainingvsinference.png){#training-vs-inference}

### Training Benchmarks

Training represents the phase where the system processes and ingests raw data to adjust and refine its parameters. Therefore, it is an algorithmic activity and involves system-level considerations, including data pipelines, storage, computing resources, and orchestration mechanisms. The goal is to ensure that the ML system can efficiently learn from data, optimizing both the model's performance and the system's resource utilization.
Expand Down Expand Up @@ -750,9 +748,9 @@ There are several benefits to adopting a data-centric approach to AI development

Additionally, a data-centric approach can often lead to simpler models that are easier to interpret and maintain. This is because the emphasis is on the data rather than the model architecture, meaning simpler models can achieve high performance when trained on high-quality data.

The shift towards data-centric AI represents a significant paradigm shift. By prioritizing the quality of the input data, this approach tries to model performance and generalization capabilities, ultimately leading to more robust and reliable AI systems. As we continue to advance in our understanding and application of AI, the data-centric approach is likely to play an important role in shaping the future of this field.
The shift towards data-centric AI represents a significant paradigm shift. By prioritizing the quality of the input data, this approach tries to model performance and generalization capabilities, ultimately leading to more robust and reliable AI systems. @fig-data-vs-model illustrates this difference. As we continue to advance in our understanding and application of AI, the data-centric approach is likely to play an important role in shaping the future of this field.

![Model-centric ML development vs. Data-centric ML development.](contents/benchmarking/images/png/datavsmodelai.png){#data-vs-model}
![Model-centric vs. Data-centric ML development. Source: [NVIDIA](https://blogs.nvidia.com/blog/difference-deep-learning-training-inference-ai/)](images/png/datavsmodelai.png){#fig-data-vs-model}

### Benchmarking Data

Expand Down
4 changes: 2 additions & 2 deletions contents/data_engineering/data_engineering.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -247,9 +247,9 @@ Data sourcing and data storage go hand in hand, and data must be stored in a for

: Comparative overview of the database, data warehouse, and data lake. {#tbl-storage .striped .hover}

The stored data is often accompanied by metadata, defined as 'data about data .'It provides detailed contextual information about the data, such as means of data creation, time of creation, attached data use license, etc. For example, [Hugging Face](https://huggingface.co/) has [Dataset Cards](https://huggingface.co/docs/hub/datasets-cards). To promote responsible data use, dataset creators should disclose potential biases through the dataset cards. These cards can educate users about a dataset's contents and limitations. The cards also give vital context on appropriate dataset usage by highlighting biases and other important details. Having this type of metadata can also allow fast retrieval if structured properly. Once the model is developed and deployed to edge devices, the storage systems can continue to store incoming data, model updates, or analytical results. @data-collection showcases the pillars of data collection and their collection methods.
The stored data is often accompanied by metadata, defined as 'data about data.' It provides detailed contextual information about the data, such as means of data creation, time of creation, attached data use license, etc. For example, [Hugging Face](https://huggingface.co/) has [Dataset Cards](https://huggingface.co/docs/hub/datasets-cards). To promote responsible data use, dataset creators should disclose potential biases through the dataset cards. These cards can educate users about a dataset's contents and limitations. The cards also give vital context on appropriate dataset usage by highlighting biases and other important details. Having this type of metadata can also allow fast retrieval if structured properly. Once the model is developed and deployed to edge devices, the storage systems can continue to store incoming data, model updates, or analytical results. @fig-data-collection showcases the pillars of data collection and their collection methods.

![Pillars of data collection.](contents/data_engineering/images/png/datacollection.png){#data-collection}
![Pillars of data collection. Source: [Alexsoft](https://www.altexsoft.com/blog/data-collection-machine-learning/)](images/png/datacollection.png){#fig-data-collection}

**Data Governance:** With a large amount of data storage, it is also imperative to have policies and practices (i.e., data governance) that help manage data during its life cycle, from acquisition to disposal. Data governance outlines how data is managed and includes making key decisions about data access and control. @fig-governance illustrates the different domains involved in data governance. It involves exercising authority and making decisions concerning data to uphold its quality, ensure compliance, maintain security, and derive value. Data governance is operationalized by developing policies, incentives, and penalties, cultivating a culture that perceives data as a valuable asset. Specific procedures and assigned authorities are implemented to safeguard data quality and monitor its utilization and related risks.

Expand Down
14 changes: 7 additions & 7 deletions contents/dl_primer/dl_primer.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ Organizations worldwide recognize deep learning's transformative potential and i

### Applications of Deep Learning

Deep learning is extensively used across numerous industries today, and its transformative impact on society is evident. In finance, it powers stock market prediction, risk assessment, and fraud detection. For instance, deep learning algorithms can predict stock market trends, guide investment strategies, and improve financial decisions. In marketing, it drives customer segmentation, personalization, and content optimization. Deep learning analyzes consumer behavior and preferences to enable highly targeted advertising and personalized content delivery. In manufacturing, deep learning streamlines production processes and enhances quality control by continuously analyzing large volumes of data. This allows companies to boost productivity and minimize waste, leading to the production of higher quality goods at lower costs. In healthcare, machine learning aids in diagnosis, treatment planning, and patient monitoring. Similarly, deep learning can make medical predictions that improve patient diagnosis and save lives. The benefits are clear: machine learning predicts with greater accuracy than humans and does so much more quickly.@deeplearning further illustrates some applications of deep learning.
Deep learning is extensively used across numerous industries today, and its transformative impact on society is evident. In finance, it powers stock market prediction, risk assessment, and fraud detection. For instance, deep learning algorithms can predict stock market trends, guide investment strategies, and improve financial decisions. In marketing, it drives customer segmentation, personalization, and content optimization. Deep learning analyzes consumer behavior and preferences to enable highly targeted advertising and personalized content delivery. In manufacturing, deep learning streamlines production processes and enhances quality control by continuously analyzing large volumes of data. This allows companies to boost productivity and minimize waste, leading to the production of higher quality goods at lower costs. In healthcare, machine learning aids in diagnosis, treatment planning, and patient monitoring. Similarly, deep learning can make medical predictions that improve patient diagnosis and save lives. The benefits are clear: machine learning predicts with greater accuracy than humans and does so much more quickly. @fig-deeplearning further illustrates some applications of deep learning.

Deep learning enhances everyday products, such as strengthening Netflix's recommender systems to provide users with more [personalized recommendations](https://dl.acm.org/doi/abs/10.1145/3543873.3587675). At Google, deep learning models have driven significant improvements in [Google Translate](https://research.google/blog/recent-advances-in-google-translate/), enabling it to handle over [100 languages](https://cloud.google.com/translate/docs/languages). Autonomous vehicles from companies like Waymo, Cruise, and Motional have become a reality through the use of deep learning in their [perception system](https://motional.com/news/technically-speaking-improving-av-perception-through-transformative-machine-learning). Additionally, Amazon employs deep learning at the edge in their Alexa devices to perform [keyword spotting](https://towardsdatascience.com/how-amazon-alexa-works-your-guide-to-natural-language-processing-ai-7506004709d3).

![Deep learning applications, benefits and implementations.](contents/dl_primer/images/png/deeplearning.png){#deeplearning}
![Deep learning applications, benefits and implementations. Source: [Leeway Hertz](https://www.leewayhertz.com/what-is-deep-learning/)](images/png/deeplearning.png){#fig-deeplearning}

### Relevance to Embedded AI

Expand Down Expand Up @@ -120,15 +120,15 @@ The training process involves several key steps, beginning with the forward pass

#### Forward Pass

The forward pass is the initial phase where data moves through the network from the input to the output layer. At the start of training, the network's weights are randomly initialized, setting the initial conditions for learning. During the forward pass, each layer performs specific computations on the input data using these weights and biases, and the results are then passed to the subsequent layer. The final output of this phase is the networks prediction. This prediction is compared to the actual target values present in the dataset to calculate the loss, which can be thought of as the difference between the predicted outputs and the target values. The loss quantifies the networks performance at this stage, providing a crucial metric for the subsequent adjustment of weights during the backward pass.
The forward pass is the initial phase where data moves through the network from the input to the output layer. At the start of training, the network's weights are randomly initialized, setting the initial conditions for learning. During the forward pass, each layer performs specific computations on the input data using these weights and biases, and the results are then passed to the subsequent layer. The final output of this phase is the network's prediction. This prediction is compared to the actual target values present in the dataset to calculate the loss, which can be thought of as the difference between the predicted outputs and the target values. The loss quantifies the network's performance at this stage, providing a crucial metric for the subsequent adjustment of weights during the backward pass.

@vid-nn below explains how neural networks work using handwritten digit recognition as an example application. It also touches on the math underlying neural nets.

:::{#vid-nn .callout-important}

@forward-propagation explains the concept of forward pass using an illustration.
@fig-forward-propagation explains the concept of forward pass using an illustration.

![Neural networks - forward and backward propagation.](contents/dl_primer/images/png/forwardpropagation.png){#forward-propagation}
![Neural networks - forward and backward propagation. Source: [Linkedin](https://www.linkedin.com/pulse/lecture2-unveiling-theoretical-foundations-ai-machine-underdown-phd-oqsuc/)](images/png/forwardpropagation.png){#fig-forward-propagation}

# Neural Networks

Expand Down Expand Up @@ -233,7 +233,7 @@ These architectures serve specific purposes and excel in different domains, offe

### Traditional ML vs Deep Learning

Deep learning extends traditional machine learning by utilizing neural networks to discern patterns in data. In contrast, traditional machine learning relies on a set of established algorithms such as decision trees, k-nearest neighbors, and support vector machines, but does not involve neural networks. To briefly highlight the differences, @tbl-mlvsdl illustrates the contrasting characteristics between traditional ML and deep learning. @ml-vs-dl further explains the differences between Machine Learning and Deep Learning.
Deep learning extends traditional machine learning by utilizing neural networks to discern patterns in data. In contrast, traditional machine learning relies on a set of established algorithms such as decision trees, k-nearest neighbors, and support vector machines, but does not involve neural networks. To briefly highlight the differences, @tbl-mlvsdl illustrates the contrasting characteristics between traditional ML and deep learning. @fig-ml-dl further explains the differences between Machine Learning and Deep Learning.

+-------------------------------+-----------------------------------------------------------+--------------------------------------------------------------+
| Aspect | Traditional ML | Deep Learning |
Expand All @@ -251,7 +251,7 @@ Deep learning extends traditional machine learning by utilizing neural networks
| Maintenance | Easier (simple to update and maintain) | Complex (requires more efforts in maintenance and updates) |
+-------------------------------+-----------------------------------------------------------+--------------------------------------------------------------+

![Comparing Machine Learning and Deep Learning.](contents/dl_primer/images/png/mlvsdl.png){#ml-vs-dl}
![Comparing Machine Learning and Deep Learning. Source: [Medium](https://aoyilmaz.medium.com/understanding-the-differences-between-deep-learning-and-machine-learning-eb41d64f1732)](images/png/mlvsdl.png){#fig-ml-dl}

: Comparison of traditional machine learning and deep learning. {#tbl-mlvsdl .striped .hover}

Expand Down
Loading

0 comments on commit 4b9b5bf

Please sign in to comment.