From 479d7b6f393bf3cfc5d7823bd6240c2736b9f664 Mon Sep 17 00:00:00 2001 From: Andre Henriques Date: Sun, 10 Mar 2024 00:09:12 +0000 Subject: [PATCH] chore: added some diagrams --- diagrams/system_diagram.d2 | 29 ++++++++++++++++ diagrams/system_diagram_complex.d2 | 53 ++++++++++++++++++++++++++++++ report/report.tex | 39 +++++++++++++++++++--- 3 files changed, 117 insertions(+), 4 deletions(-) create mode 100644 diagrams/system_diagram.d2 create mode 100644 diagrams/system_diagram_complex.d2 diff --git a/diagrams/system_diagram.d2 b/diagrams/system_diagram.d2 new file mode 100644 index 0000000..cb77fe5 --- /dev/null +++ b/diagrams/system_diagram.d2 @@ -0,0 +1,29 @@ +User.shape: Person +Server.shape: Cloud + +Proxy.shape: Hexagon + +Api: "API Server" { } +Web: "Web Server" { } +Runner: "Model Runner" { + style.multiple: true +} +Train: "Model Trainer" { + style.multiple: true +} + +database: "Database" { + shape: cylinder +} + +User->Proxy +Server->Proxy + +Proxy->Api +Proxy->Web + +Api->Database +Api->Runner +Api->Train + + diff --git a/diagrams/system_diagram_complex.d2 b/diagrams/system_diagram_complex.d2 new file mode 100644 index 0000000..78c0bc3 --- /dev/null +++ b/diagrams/system_diagram_complex.d2 @@ -0,0 +1,53 @@ +database: "Database" { + shape: cylinder +} + +Model: "Model Data" { + shape: cylinder + style.multiple: true +} + +Dataset: "Dataset Data" { + shape: cylinder + style.multiple: true +} + +Api: "API Server" { } +Runner: "Model Runner" { + style.multiple: true +} + +Train: "Model Trainer" { + style.multiple: true +} + +static_server: "Web App Static Server" { } + +User.shape: Person + +Server.shape: Cloud + +static_server->User: Send control webpage +User->Api: Manage Models, Accounts, Permissions + +Server->Api: Request processing of images +Api->database +Api->Model: Manage Models +Api->Dataset: Manage Datasets + +Api<->Runner: Run the model +Api<->Train: Train the model +Model->Runner: Load Models +Dataset->Runner: Load Datasets +Runner->Api: Update status of task + +Train<->Model: Load and Save Models +Train->Dataset: Load Datasets +Model->Train: Load Models +Dataset->Train: Load Datasets +Train->Model: Save Models +Train->Api: Update status of task + + + + diff --git a/report/report.tex b/report/report.tex index 0e41c85..649940d 100644 --- a/report/report.tex +++ b/report/report.tex @@ -59,6 +59,7 @@ \today \end{center} + \newpage \newpage \begin{center} @@ -72,6 +73,7 @@ plagiarised will be penalised. \vspace*{\fill} \end{center} + \newpage \newpage \begin{center} @@ -85,6 +87,7 @@ encouragement from the first day of the university. \vspace*{\fill} \end{center} + \newpage \newpage \begin{center} @@ -96,6 +99,7 @@ \vspace*{\fill} \end{center} \newpage + \newpage \tableofcontents \newpage @@ -197,7 +201,8 @@ % EfficientNet EfficientNet \cite{efficient-net} is a deep convolution neural network that was able to achieve $84.3\%$ top-1 accuracy while ``$8.4x$ smaller and $6.1x$ faster on inference than the best existing ConvNet''. EfficientNets \footnote{the family of models that use the thecniques that described in \cite{efficient-net}} are models that instead of the of just increasing the depth or the width of the model, we increase all the parameters at the same time by a constant value. By not scaling only depth, EfficientNets can acquire more information about the images, specially the image size is considered. To test their results, the EfficientNet team created a baseline model which as a building block used the mobile inverted bottleneck MBConv \cite{inverted-bottleneck-mobilenet}. The baseline model was then scaled using the compound method, which resulted in better top-1 and top-5 accuracy. - While EfficientNets are smaller than their non-EfficientNet counterparts, they are more computational intensive, a ResNet-50 scaled using the EfficientNet compound scaling method is $3\%$ more computational intensive than a ResNet-50 scaled using only depth while improving the top-1 accuracy by $0.7\%$, and as the model will be trained and run multiple times decreasing the computational cost might be a better overall target for sustainability then being able to offer higher accuracies. + While EfficientNets are smaller than their non-EfficientNet counterparts, they are more computational intensive, a ResNet-50 scaled using the EfficientNet compound scaling method is $3\%$ more computational intensive than a ResNet-50 scaled using only depth while improving the top-1 accuracy by $0.7\%$. + And as the model will be trained and run multiple times decreasing the computational cost might be a better overall target for sustainability then being able to offer higher accuracies. Even though scaling using the EfficientNet compound method might not yield the best results using some EfficientNets what were optimized by the team to would be optimal, for example, EfficientNet-B1 is both small and efficient while still obtaining $79.1\%$ top-1 accuracy in ImageNet, and realistically the datasets that this system will process will be smaller and more scope specific than ImageNet. % \subsection{Efficiency of transfer learning} @@ -268,12 +273,38 @@ This section will discuss the design of the system. The section will discuss the inter application interface, control platform, and server, dataset, and model management. + \subsection{Structure of the Service} + + \begin{figure} + \begin{center} + \includegraphics{system_diagram} + \end{center} + \caption{Simplified diagram of the service}\label{fig:simplified_service_diagram} + \end{figure} + + The service is designed to be a 4 tier structure: + \begin{itemize} + \item{Presentaion Layer} + \item{Api Layer} + \item{Work Layer} + \item{Database Layer} + \end{itemize} + + This structure was selected because it allows separation of concerns to happen based on the resourses required by that layer. + + The presentaion layer requires interactivity of the user, therefore it needs to be accessible from the outside, and be simple to use. + The presentaion layer consisnts of a webpage that interacts with the Api layer, to manage both the resourses allocated to users and administrators of the system. + More specific details of the implementaion can be found in \ref{web-app-design}. + + The Api layer, controls the system, it's the interface that both the webpage and customer servers use to interact with the system. + + \subsection{Inter Application Interface} As a software as a service, one of the main requirements is to be able to communicate with other services. - The current main way that servers communicate over the internet is using https and a rest JSON API\cite{json-api-usage-stats} + The current main way that servers communicate over the internet is using https and a rest JSON API\cite{json-api-usage-stats}. - \subsection{Web application} + \subsection{Web application} \label{web-app-design} Why use a web application to control the system? @@ -313,7 +344,7 @@ - + \pagebreak \section{Design Choices} \subsection{Structure of the Service} The system has to manage: