In this paper, we present a new AI  edge platform, called “MiniDeep”, which provides a standalone deep learning platform based on the cloud-edge architecture. This AI-Edge platform provides developers with a whole deep learning development environment to set up their deep learning life cycle processes, such as model training, model evaluation, model deployment, model inference, ground truth collecting, data pre-processing, and training data management. To the best of our knowledge, such a whole deep learning development environment has not been built before. MiniDeep uses Amazon Web Services (AWS) as the backend platform of a deep learning tuning management model. In the edge device, the OpenVino enables deep learning inference acceleration at the edge. To perform a deep learning life cycle job, MiniDeep proposes a mini deep life cycle (MDLC) system which is composed of several microservices from the cloud to the edge. MiniDeep provides Train Job Creator (TJC) for training dataset management and the models’ training schedule and Model Packager (MP) for model package management. All of them are based on several AWS cloud services. On the edge device, MiniDeep provides Inference Handler (IH) to handle deep learning inference by hosting RESTful API (Application Programming Interface) requests/responses from the end device. Data Provider (DP) is responsible for ground truth collection and dataset synchronization for the cloud. With the deep learning ability, this paper uses the MiniDeep platform to implement a recommendation system for AI-QSR (Quick Service Restaurant) KIOSK (interactive kiosk) application. AI-QSR uses the MiniDeep platform to train an LSTM (Long Short-Term Memory)-based recommendation system. The LSTM-based recommendation system converts KIOSK UI (User Interface) flow to the flow sequence and performs sequential recommendations with food suggestions. At the end of this paper, the efficiency of the proposed MiniDeep is verified through real experiments. The experiment results have demonstrated that the proposed LSTM-based scheme performs better than the rule-based scheme in terms of purchase hit accuracy, categorical cross-entropy, precision, recall, and F1 score. Deep learning is a fast growing technology that has attracted lots of attention recently. The deep learning makes a lot of applications feasible. Deep learning has been widely adopted in many fields, such as computer vision, image recognition, speech recognition, and natural language processing.However, the effectiveness of deep learning is based on the machine computing capability. Deep learning has two main aspects which are relative to computing power, i.e., the training aspect and the inference aspect. The training aspect is an important part to determine the overall outcome of deep learning. As a typical neural network model, deep learning requires training data to learn what the high dimension feature of the dataset is. On the other hand, the inference aspect is the step of putting a deep learning model into the production environment for prediction. The inference aspect relies on the weights of the trained model to provide a prediction of the outcome by passing input to the neural network model and then obtaining the prediction output. Both the training aspect and the inference aspect rely on the computing power. Both of them need a powerful graphics card, which is good at a large number of parallel instruction operations and has enough memory space to perform high-performance data handling.The other issue is the software dependency with deep learning. In order to use the deep learning model, we need to prepare the entire deep learning software environment, such as TensorFlow, Nvidia CUDA library, Keras, python, etc. This is a barrier when we deploy our applications. We also need to make sure that other libraries work fine. The limitation described above makes the deployment more difficult.In order to overcome the deep learning hardware restriction and software dependency, an idea that can make deep learning environment stand alone from the local machine is proposed. Using the cloud service to perform deep learning is an easier and effective way to do that. Cloud computing is a distributed system to provide highly scalable and resilient environments. It provides the hardware resource by means of on-demand and moving training, and making inferences on the cloud platform is a solution that is not limited by the hardware computing power. In addition, the software dependency effort will be reduced significantly because all of the software dependency such as the library and environment can be moved to the cloud side. The local machine only needs to handle the software dependency about the application itself.Although moving the training and inference process to a cloud platform to help our hardware computing demand and software dependency reduction is a good choice, the issue relative to the network behavior needs to be discussed. In principle, we need to send the inference request to the cloud service, triggering the inference process with provided predict input data, obtain the output from the inference result, and then send a response to the local machine, which requests the inference result. In this case, deep learning on the cloud will cause a lot of delays due to network packet exchange. Obtaining a real-time inference response is hard. However, most of the popular deep learning applications, such as face detection, object recognition, semantic segmentation, rely on real-time predictions. They need to upload large amounts of image data to the cloud service, then use a well-known model such as convolution neural network (CNN) to perform the inference processing with many CPU intensive operations and the high-dimension nonlinear calculation going through the CNN model, and finally send the data back to the local device. The latency of inference response is unacceptable for real-time predictions.The other problem is the loading of the cloud server. Assume that we have a cluster system, which is composed of the central cloud and branches of the local device application. This application will send the inference request to the central cloud. Because all of the applications need to obtain the inference resources from the central cloud, deep learning computing on the cloud will produce a large amount of packets, and the cloud service needs to handle those requests. Deep learning computing on the cloud will cause a huge loading on the cloud service. Even though we can choose higher performance cloud services and more sustainable cloud machines, deep learning computing on the cloud will cost more and more money on this issue.Deep learning on the edge is a solution for the above issue. Deep learning on the edge can reduce the bandwidth and latency when we send our packet to the nearby edge device. Deep learning on the edge can make it easier for the network to work effectively. Therefore, if we move the inference process from the cloud to the edge, real-time inference through the network becomes feasible.In summary, edge inference/cloud training is a robotic architecture to achieve the two main goals. One is the standalone ability. This feature resolves the hardware restriction and software dependency on the local machine application by moving the deep learning process away from the local machine. The other is traffic-free; this feature reduces a large amount of traffic effort by using the edge device as the nearest computing resource. Therefore, building a standalone and traffic-free platform is necessary. In this paper, we provide developers with a whole deep learning development environment called MiniDeep to set up their deep learning life cycle processes. To the best of our knowledge, the existing AI-Edge platforms ,2,3 do nThe contributions of the proposed scheme are listed as follows.We have proposed and built a new AI-Edge platform called “MiniDeep”.The proposed MiniDeep can provide developers with a whole deep learning development environment to set up their deep learning life cycle processes, such as model training, model evaluation, model deployment, model inference, ground truth collecting, data pre-processing, and training data management. To the best of our knowledge, such a whole deep learning development environment has not been built before.The proposed MiniDeep can use a stand-alone mini-size PC as the edge device. Hence, it can be deployed on the nearby local machine easily, and it has the ability to provide a plug and play feature.In the proposed platform, a cloud-edge based deep learning software system can use the edge device to perform inference and use the cloud service to train the neural network model.A recommendation system for AI-QSR (Quick Service Restaurant) KIOSK (interactive kiosk) application has been implemented on the proposed platform. The experiment results have demonstrated the effectiveness of this recommendation system.The remainder of this paper is organized as follows. Jacob et al.  use RaspThrough the above discussion, we can summarize that edge computing and cloud-edge collaboration can be adopted to applications such as inference and object recognition. Many AI-based recommendation systems have been proposed and proven to be effective. However, the AI-based recommendation systems have not been built on an AI-Edge platform. To build an AI-based recommendation system on the AI-Edge platform, we have proposed a novel AI-Edge platform called “MiniDeep”. MiniDeep provides developers with a whole deep learning development environment to set up their deep learning life cycle processes. With MiniDeep, developers can build an AI-based edge-cloud system more easily. Although many AI-Edge platforms have been proposed ,2,3, theThis section describes the knowledge of the edge-cloud architecture and introduces the cloud service and edge environment that are used in this paper.Typically, a deep learning life cycle contains many detailed procedures. There are several procedures in a life cycle such as data collecting, data pre-possessing, model training, model evaluation, model deployment, inference monitoring, and starting a new life cycle by going back to data collecting. Implementing the deep learning life cycle on the production machine may incur challenges because deep learning needs to compute tons of neural forward operations to obtain the model inference output. Training a model on a production machine is also a very difficult solution because of the poor hardware computing power on the production machine. In summary, separating the computing resource of the production machine from actual deep learning computing is a good choice to prevent deep learning computation from occupying the whole computing power of the production machine. In this paper, we propose a standalone deep learning platform in mini pc. Mini pc is based on the edge-cloud architecture and has the ability to train and inference a deep learning model for the production machine.The system architecture of the edge-cloud model for deep learning is shown in The machine learning service gives the developer a deep learning developing environment to train a deep learning model with various computing hardware instances. The machine learning service generally provides the script coding, model training, hyperparameter tuning, and model storing when developing on the cloud.The remaining part of the cloud side is the continuous training management and AI deployment service. The continuous training management is a process to manage model training scripts and schedule the period to obtain training data and perform online training automatically. Deploying a deep learning service on the edge device needs to rely on the AI deployment service. The AI deployment service provides the ability to deploy a trained model automatically to the edge device when the deep learning model has been trained successfully.The edge side is based on the embedded system device or the PC for deep learning inference. The edge side uses the computing hardware to compute the deep learning model inference. There are many options for choosing computing hardware, such as an embedded system board, AI Chips, AI USB, etc. An Nvidia Jeston TX2 embedded board has a dual-core NVIDIA Denver2, a quad-core ARM Cortex-A57 CPU, and a 256-core Pascal GPU. Nvidia Jeston TX2 is suitable for developing deep learning inference work on the edge side. The other choice is to use mini pc with an external computing resource. Using an Intel neural compute stick is a good choice for the edge device whose computing power is not enough to cope with the deep learning inference.The AI acceleration platform on the edge side is an environment that helps the edge device to enable hardware computing acceleration. The edge device acceleration platform has many optimizing operations to accelerate the deep learning inference, such as parallel computing, heterogeneous calculation, neural network optimization, etc. OpenVino enables CNN-based deep learning inference at the edge and supports heterogeneous execution across computer vision accelerators .The remaining part of the edge side is the data synchronizer and deployed environment. The data synchronizer is a local data storage management system which has the ability to handle the data uploading process from the edge to the cloud. The data synchronizer also provides the definition of the pre-processing process for new data collected from the inference. The deployed environment is a model deployment and model inference execution environment on the edge device. This environment is often based on the AI acceleration platform to perform deep learning inference. This environment also needs to provide a restful API interface so that the local application device can send a request and obtain a response from the deep learning inference to the edge device.In this paper, MiniDeep uses Amazon Web Service (AWS) as a deep learning model management platform. MiniDeep uses AWS to handle some deep learning jobs, such as data storing, model training, model evaluation, and model deployment. Sagemaker is one of the AWS that provides a platform to host a deep learning runtime environment. The runtime environment can train the model and evaluate the model with the uploading model script from the developer. Sagemaker provides the training hardware which you need so that the developer can only focus on the deep learning operation without worrying about hardware maintenance. AWS IoT GreenGrass is one of the AWS that can bring AWS services to the edge device. GreenGrass can choose the serverless instance with user scripts and the package serverless instance as a GreenGrass core which can be deployed to the edge device. With this feature, GreenGrass can provide a solution to package the deep learning model to the edge and keep tracking the edge device status by the GreenGrass core feature.The above two services are the main services which MiniDeep deep learning operations are based on. Other than this, the basic serverless service as a platform module is needed to be used to implement the core function. MiniDeep uses AWS Lambda service to host a serverless runtime to compute the application logic by demand. Using the AWS lambda service can only focus on what system logic you care about, and you do not need to care about what infrastructure and operation environment you used. For data storing, MiniDeep uses AWS DynamoDB to support the platform for storing the training data uploaded from the edge side. With AWS Lambda service and DynamoDB service, MiniDeep can build a suitable serverless architecture with our system.This section introduces the runtime environment which is built in the MiniDeep edge device. The edge device uses Intel OpenVino as the hardware acceleration platform so that MiniDeep can make inferences more efficient by hardware acceleration. We know that OpenVino has its limitations. However, we aim to use a non-Nvidia (mainstream) architecture. We want to confirm that using OpenVino plus Intel Movidius is more suitable for an environment with small space, no fan, and less maintenance. The Intel OpenVino is used in the CNN-based deep learning inference at the edge, and it supports heterogeneous execution on the hardware resource of the edge device. With the acceleration ability, OpenVino executes deep learning acceleration on CPU, GPU, Intel Movidius Neural Compute Stick, and FPGA. OpenVino is composed of the Model optimizer and Inference engine.A model optimizer is a command-line tool that performs static model analysis and adjusts deep learning models for the optimal execution on edge devices. After that, the model optimizer produces an Intermediate Representation (IR) of the network, which can be loaded with the Inference Engine.The Inference Engine is a C++ library with a set of C++ classes to obtain the inference result. The C++ library provides an API to read IR which is obtained from the model optimizer. The input and output formats are set, and the inference result on edge devices is executed. The Inference Engine allows high-performance inference by paralleling execution and heterogeneous execution on many hardware types including Intel CPU, GPU, FPGA, and an Intel Movidius Neural Compute Stick.In order to accelerate with the help of external hardware, the Intel Movidius Neural Compute Stick is plugged into the MiniDeep edge device. With Neural Compute Stick (NCS), Intel NCS can help to accelerate the inference for poor hardware computing devices. NCS may provide an environment with fast response inference for real-time applications.In this paper, there is an AI-QSR  KIOSK (interactive kiosk) application based on the MiniDeep platform. The AI-QSR has a recommendation system to recommend to the end-users which food they may like to purchase. The goal of the recommendation system aims to provide a high purchase intention QSR recommendation service.n is the total number of food items in the AI-QSR application. For each food item F, c is the number of categories. m is the number of menus. The food item is the basic element in the AI-QSR system. The composition of the multiple food items can be a combo suit. For example, one hamburger food item and drink food item can be a basic hamburger combo suit. The AI-QSR has a menu category where each element in the menu category is a food item or a food combo suit. In this case, all the food items in AI-QSR can be represented as a set U, there is a t is the time step of the most current click event, and each click event k is the total number of food items purchased by the user. Each purchased item is a food item given by The user’s information data contain the important descriptions to represent a user’s feature, which can be obtained from a camera, user interface, or usage flow. For each user For the symbol representation of food item The QSR-FS problem described in the previous paragraph can be formulated as follows.A in the QSR-FS problem. y that is a non-negative real-valued function, which is usually represented as X for the input data of the QSR-FS formula, as shown in Equation ,,LA≈arIn this section, the MiniDeep system architecture is described in In the MiniDeep system, deep learning model management relies on cloud microservice modules, i.e., Train Job Creator and Model Deployer. The MiniDeep user uploads their model handling script on Train Job Creator. The model handling script contains the procedure of how the model will be trained, the model will be evaluated, and the dataset will be used. The dataset can be provided by Data Provider, which collects the ground truth data on the end device and synchronizes to Train Job Creator or is provided directly by DeepLearning Provider SDK, which sends the ground truth data to Train Job Creator directly. After the MiniDeep user uploads their model handling script, the MiniDeep can start model training and model evaluation by using the MiniDeep management tool. The model deployer can take a trained model from the Train Job Creator and package model as a serverless runtime function base on the AWS lambda service. The MiniDeep user can choose which model they want to package and how many of the different models they want to bring together.After the MiniDeep user finishes their model tuning work on the cloud, the model can be pulled from the Model Deployer to the Inference Engine Handler in the edge device by the MiniDeep management tool. Then, the Inference Engine Handler obtains the model that is packaged as GreenGrass core and then deploy GreenGrass core in the runtime environment of the Inference Engine Handler. The end device can send the RESTful API request to the edge device and then obtain the inference result from the edge device.When the end device obtains the inference result, the edge device can also obtain the ground truth from the correct feedback of the end-user in the application. The end-device application can send back the correct label of the user as the new training data to the MiniDeep system. The MiniDeep user uses the MiniDeep management tool to upload the new training data to the Data Provider on the edge device or send the new training data directly to the Train Job Creator dataset database. The Data Provider itself also manages the new training data and synchronizes the new training data by mechanisms between the Data Provider and Train Job Creator.This section describes how the individual microservice module works in the training and inference phases. This section also describes how the microservice modules co-work together to upload training data and deploy the inference model by our protocol.The detailed functions of the Data Provider (DP) and Train Job Creator (TJC) are described as follows.The training_dataset_management component is a MongoDB-based training database. The component, which is called the training_dataset_management component, stores the data uploaded from the local device, manages data as a JSON format data in the database, and then returns the unsynchronized training data to the Train Job Creator. The training_dataset_management component represents the dataset as The data stored in training dataset management can also be divided into two parts, synchronized training dataset The data_collection_service is a RESTful endpoint which listens to the HTTP connection and accepts post requests from the local device which sends a new training datum The training_dataset_service is also a RESTful endpoint which listens to the HTTP connection and accepts the HTTP GET request to obtain the unsynchronized training data After obtaining the training data from the edge, the TJC can manage the training data, training script, training job, and model artifacts on the cloud. T is given by:D is represented as The dataset_management is used to manage the training dataset. The training dataset The route table of the dataset is used to record what model script is used in training the database quations  and 13)Dit^. ForWhen MiniDeep manages the deep learning model training, MiniDeep needs the model script to know how to train deep learning model for the dataset by the procedure written in the model script. The model script is managed by the model_script_management component. The model_script_management component uses simple storage service as a backend service to handle model script storing, and the model script Each model script With this dataset route table The data_synchronize_trigger_service has a lambda runtime which hosts a trigger route controller. The controller uses a device_trigger table to find which trigger is needed to forward to which device. The service handles the new trigger event to perform data fetching from the end device, and the trigger finds the end device The event schedule service has the ability to set an event rule on the CloudWatch service. This service provides an interface to set an event, and the event is used to announce the service which is called the data_synchronize_trigger_service to obtain the new training data and to launch the training script If MiniDeep wants to manage training script The training job management is a component that provides the training job environment with the full management of the service runtime. This management service is based on the sagemaker runtime, and it provides the setting option to define the hardware acceleration solution being applied on the training job. The training job is represented as a training script process which provides the sagemaker runtime to know what model architecture needs to be trained and how to train a deep learning model by the method written in the script. The training job The training job Equation  shows thThe training_status_handles_service provides an API that the MiniDeep user can use to obtain the training job status, training log, training metrics, or set the resulting trigger so that the MiniDeep can obtain the result event when the MiniDeep user sets the result trigger callback. The training_status_handle_service contains an instance result trigger and model status publisher. The instance trigger is an event handler which listens to the model train job status and records The model artifact management is a component that manages the model artifact The model_artifact_service provides the function to control the model artifact on the cloud, the model_artifact_service can obtain, update, and delete the model artifact in model artifact management. The model_artifact_service also provides the API to let another service obtain the artifact to perform deep learning. The model_artifact_service contains a model artifact controller and artifact switching host. The model artifact controller provides the ability to manage the model artifact and handle the model retrieve request. The artifact switching host can provide the model switching feature. The mode switching is a function that can record which MiniDeep edge device uses the artifact service. If the model artifact has been updated, the next time, the MiniDeep edge device will know the new model available and download it. The training_status_handle_service is placed in the lambda service to serve as a microservice.All of the above management components and microservices are the core feature of the Train Job Creator. The whole functionality can be access by the AWS console. The MiniDeep edge also provides API to control the Train Job Creator. After all, if the MiniDeep user finishes the model training logic, the model deployer manages and controls the model management.S1.De_id, event_type, event_opt, d_set_name) to the event_schedule_service and creates an f_event on the cloud. The event_schedule_service sets the event by event_type and event_opt. After setting the event, if the APP has the new training data, the APP will send the training data to the new training cycle. The APP sends a message which is called DP_ins  to control the data_synchronize_trigger_service and the data_synchronize_trigger_service to send a DS_fetch_message  so as to fetch the new training data. The training_dataset_service receives the DS_fetch_message and issues an SD_response  and Train Job Creator (TJC) are important modules to complete the deep learning training process. The detailed procedure of MiniDeep training is shown in As shown in The inference instance management component has several lambda environment definitions, which are deployed to the local device. The lambda environment set The greengrass core management contains greengrass core set The service in model deployer is the core function to finish our deployment job. The inference_package_service in Model Deployer can be called by the outside local application request. The inference_package_service can download model artifact The core_packager_service also can handle a local application request that creates the greengrass core and deploys a greengrass core in the edge device. The core packager has an inference instance controller to choose several inference instances The inference engine handler is a core module whose main mission is to host a deep learning inference environment to help the local device access the deep learning computing resource. The inference engine handler contains a greengrass_core_loader_service and openvino_handler_service to achieve the main mission. The overview of the detailed function of the inference engine handler is shown in The greengrass_core_loader_service has a greengrass core updater to obtain the new greengrass core The openvino_handler_service hosts an openvino inference engine and an openvino model optimizer. The openvino model optimizer is an openvino core function which can parse the deep learning model generated from the deep learning platform, such as tensorflow, Mxnet, caffe, etc. The model optimizer converts the deep learning model to the IR (Intermediate Representation) file. The IR file consists of the *.bin file as the model weight and *.xml as the deep learning model architecture. The inference engine reads the IR files, and it hosts a deep learning computing acceleration environment for the IR model. In our openvino_handler_service, MiniDeep has an inference endpoint to handle the outside HTTP request for inference and a model loader to load the deep learning model to the model optimizer to obtain the IR file. The openvino host function can read the inference instance resource and bring the inference instance resource to the model loader to obtain the IR and put the IR to the inference endpoint. The local application can send HTTP to obtain the request of the inference and then obtain the response of the inference.There are two main microservices, the model deployer and the inference engine handler. S1.The user sends an IIC_message  KIOSK (interactive kiosk) is proposed to demonstrate the MiniDeep platform result. The AI-QSR system architecture is shown in In the AI-QSR system architecture, the quick service restaurant application served in KIOSK can provide a friendly user interface to show the menu, food, suit, and applications. The AI-QSR has a feature that can recommend the most likely purchased food to the user. When the KIOSK user clicks the element of application such as food, menu, or suit, the application will check the condition and decide to make a recommendation to the user. When the application needs a recommendation, the application will send a request to the recommendation system on the MINI-PC, and the recommendation system collects the user face images taken from the camera and the click event as a flow-sequence to request the inference result from the MiniDeep platform. The Inference Engine Handler accepts the inference request and computes an inference result for the recommendation system. This recommendation system sends back the inference result to the application. Then, the application shows the recommendation result.The recommendation problem in the scenario of the AI-QSR system is regarded as the QSR-FS problem, which is described in Except for the deep learning model, the QSR-FS problem also needs two function blocks and three function triggers to work together. The two function blocks are the recommend controller and the food item aggregator. The recommend controller controls the trigger event and operates the other function block. The food item aggregator collects the food item candidate from the LSTM of the QSR-FS problem. If the recommend controller sends a control message to the food item aggregator, the food item aggregator will send its output to calculate the recommendation result. The three function triggers are the event entries that every event entry can use to trigger the recommend controller to start a recommendation candidate selection and food item recommendation. The three function triggers are the popup trigger, the wait trigger, and the browsing trigger. The popup trigger comes from the popup event in the AI-QSR. The wait trigger comes from the user’s waiting time exceeding the timeout. The browsing trigger comes from the user’s clicking count that without purchasing anything.For the QSR-FS problem, our training data are represented as n github . For the. In summary, the detailed procedure of obtaining the recommendation food result with the MiniDeep platform is given below:S1.N flow sequences (The LSTM of the QSR-FS problem can compute the S2.The FI_aggregator collects the food item candidates S3.When the user hits the T_condition (trigger condition) defined on the AI-QSR application, the AI-QSR application sends an S4.The camera takes a picture of the user and passes the user’s face image to the pre-trained age–gender estimator to obtain S5.At the end of the fully connective layer, the output result is called The purposed LSTM-based scheme of the QSR-FS problem is an LSTM which parses the QSR-FS click event sequence. This sequence is called the Flow Sequence (FS). The Flow Sequence is a serial of the click events. The user’s clicking of each QSR element on the AI-QSR user interface will be recorded. The click event is converted to the AI-QSR element character. All the AI-QSR element characters are combined as a flow sequence. Each flow sequence contains very lengthy AI-QSR element characters which use one-hit-encoding to represent it. The flow sequence The AI-QSR in S1 converts the Flow Sequence to the food items candidates. In S2, the AI-QSR performs food items aggregation to combine food item candidates together. In S3, AI-QSR launches a recommendation when the user hits the T_condition. In S4, the age–gender detection is going to find the user’s age and gender. Finally, in S5, the AI-QSR calculates the recommendation result by the result of the last fully connective layer.In the paper, the MiniDeep platform is used to implement the LSTM solution of the QSR-FS problem in the AI-QSR application and is shown in The experimental environment of the AI-QSR application and the performance analysis of the LSTM-based solution of the QSR-FS problem are shown in this section.There is a big touch-screen KIOSK with a camera in the experimental environment. KIOSK uses a LIVA X Mini PC as the host PC with Intel Bay Trail-M/Bay Trail-I SOC 2.25 GHz and 2GB DDR3 RAM. The AI-QSR front-end interface is the host in LIVA X Mini PC. A MiniDeep platform uses a Liva Q Mini PC as the edge PC with Intel Apollo Lake Celeron N3350 SOC and 4GB/32GB eMMC. The edge PC is connected with the host PC with a network cable, and the edge PC uses LAN to communicate with the host PC. The MiniDeep platform also has the Ethernet capability to access AWS services. An Intel Movidius neural compute stick is plugged in the edge PC so that the MiniDeep platform can perform high-speed acceleration for inference. The training data are collected from the Computex 2019 exhibition in Taipei. In total, 623 users’ click data and face data are collected during the 5 days. The training data are collected through the AI-QSR user interface (UI) in the demo mode. Here, 80% of the collected data is used for training and 20% of the collected data is used for testing. After the Computex exhibition, the training result is stored on AWS cloud storage, and then, our team trains the LSTM-based model of the QSR-FS problem with the new training data on the sagemaker cloud service. After completed training, the trained model is deployed to the edge PC of AI-QSR KIOSK.When the AI-QSR UI uses AI mode, the AI-QSR recommends food order with the inference result of the LSTM-based solution of the QSR-FS problem. In The performance analysis is presented in this section. There are three recommend triggers: the popup trigger, the idle trigger, and the browsing trigger. The experiment compares the rule-based scheme with the proposed LSTM-based scheme and uses some metrics to evaluate the performance of the two schemes. The performance metrics are defined as follows.Purchase hit accuracy: The matching possibility of the food recommending by the scheme and users’ purchases.Categorical cross-entropy: By calculating the size of the loss function, categorical cross-entropy is the main basis in the learning process and an important criterion for judging the merits of the algorithm after learning.Precision: Precision is the ratio of all “correctly retrieved results (True Positive)” to all “actually retrieved ”.Recall: Recall is the ratio of all “correctly retrieved results (True Positive)” to all “results that should be retrieved ”.F1 score: F1 score is the weighted harmonic average of Precision and Recall. When the F1 score is high, it can be proved that the test scheme is effective.The purchase hit accuracy is defined as follows.Among the three types of time proportion, the browsing-triggered recommendation recommends products from the contents the users repeatedly search and browse, and thus, it is the most accurate. The click rate of the products recommended by the idle-triggered recommendation is the lowest because the recommendation is made through too little information of the users. The accuracy of the popup-triggered recommendation is worse than that of the browsing-triggered recommendation because the identification accuracy of age and gender is not accurate enough or because of the regional cultural differences.n is the total number of the training data, j-th training input, j-th desired output, and j-th output of the neural network.The cross-entropy loss function is shown as follows, where The categorical cross-entropy loss is the sum of the cross-entropy loss of each category. The smaller the categorical cross-entropy loss is, the training result is more likely to fit the true world data. Among the three types of time proportion, since the browsing-dominated time proportion is the most accurate, followed by the popup and idle-dominated time proportion, the categorical cross-entropy loss of the browsing-dominated time proportion is the lowest, which is followed by the popup and idle-dominated time proportion.The precision of the confusion matrix is shown as follows.The recall of the confusion matrix is shown as follows.The F1 score of the confusion matrix is shown as follows.The training iterations is a hyperparameter. In this paper, we have proposed a new AI-Edge platform called MiniDeep. The MiniDeep platform provides developers with a whole deep learning development environment to set up their deep learning life cycle processes, such as model training, model evaluation, model deployment, model inference, ground truth collecting, data pre-processing, and training data management. To the best of our knowledge, such a whole deep learning development environment has not been proposed before. We build a Deep Learning-Based MINI-PC and an AI-QSR KIOSK system with food recommendations on the MiniDeep platform. The recommendation system uses an LSTM-based scheme to solve the QSR-FS problem. The experiment results show that the proposed LSTM-based scheme performs better than the rule-based scheme in terms of purchase hit accuracy, categorical cross-entropy, precision, recall, and F1 score. These results demonstrate the effectiveness of the proposed AI-Edge platform. In the future, we plan to improve the generality and usability of the MiniDeep platform so that more AI-based applications can be built on the MiniDeep platform.


Mobile app developers are often obliged by regulatory frameworks to provide a privacy policy in natural comprehensible language to describe their apps’ privacy practices. However, prior research has revealed that: (1) not all app developers offer links to their privacy policies; and (2) even if they do offer such access, it is difficult to determine if it is a valid link to a  policy. While many prior studies looked at this issue in Google Play Store, Apple App Store, and particularly the iOS store, is much less clear. In this paper, we conduct the first and the largest study to investigate the previous issues in the iOS app store ecosystem. First, we introduce an App Privacy Policy Extractor (APPE), a system that embraces and analyses the metadata of over two million apps to give insightful information about the distribution of the supposed privacy policies, and the content of the provided privacy policy links, store-wide. The result shows that only 58.5% of apps provide links to purported privacy policies, while 39.3% do not provide policy links at all. Our investigation of the provided links shows that only 38.4% of those links were directed to actual privacy policies, while 61.6% failed to lead to a privacy policy. Further, for research purposes we introduce the App Privacy Policy Corpus (APPC-451K); the largest app privacy policy corpus consisting of data relating to more than 451K verified privacy policies. It is widely recognised that almost all online services, including mobile apps, collect and share users’ personal information. Prior work shows that mobile apps access sensitive functionality and data  that are not in their core functionality ,2. ReseaIn the absence of comprehensive global legislation, various organisations around the world have enacted privacy laws to enforce online services to provide privacy policies to outline the data practices conducted by their services. For instance, the European Union (EU) has developed and implemented the General Data Protection Regulation (GDPR)  which reObviously, app stores are not an exception, and consequently global app stores such as Google Play and Apple App Store require app developers to provide a link to their privacy policies. As a general rule, both Google Play Store and Apple App Store instruct the developers to add privacy policy links to their apps store listing to comprehensively disclose how their apps collect, use, and share user data. The links of the privacy policies must be provided on the apps store listing page and within the app ,12. HoweIt is not surprising that Apple has made heavy investments in branding itself as a privacy-centric firm. In fact, the company seeks to gain a competitive advantage by placing a large emphasis on privacy and protecting consumer information . For insIn this study, we challenge the perception that Apple is a privacy-centric company by scrutinising the compliance of iOS apps in terms of providing privacy policies. For the purpose of launching this mission, we developed the App Privacy Policy Extractor (APPE), a system that evaluates the status of the apps’ privacy policy in the iOS app store. APPE not only determines the occurrence of the privacy policy link for every single app across the store, but it also examines and verifies the content of each provided link. APPE gives insightful information about the distribution and occurrence of the privacy policy across the entire iOS store and in every app category independently. Such a process may underline/identify the categories that need more attention from users when installing the apps, in addition to regulators and privacy organisations. The APPE system involves several phases including crawling the App Store, determining the availability of privacy policies links, scraping the alleged policy pages, and analysing their content. APPE is pictured in What is the status of privacy policy distribution across the Apple iOS store?How many apps provided attainable privacy policy links across the entire iOS store?Is there a difference across app categories in providing attainable privacy policies?Throughout this paper, we seek to find answers to the following research questions:The first and second questions are addressed in To the best of our knowledge, our work is the first and largest research initiative that has assessed the privacy status in the entire Apple iOS App Store, as well as providing a comprehensive overview of the privacy policies for each category of apps.We introduce the App Privacy Policy Extractor APPE; a system that assesses the status of privacy policies across the entire iOS app store. APPE does not only reveal if apps provided links to their privacy policy (or not), it also follows the provided links, analyses their contents, and determines whether or not they lead to a valid privacy policy.An analysis of the entire iOS app store privacy source. Based on APPE analysis, we present an extensive privacy survey of over two million apps in the Apple iOS App Store. Our analysis finds that substantial numbers of the apps have privacy compliance issues. Specifically, almost 40% of the apps did not provide links to the privacy policy and over 60% of the provided links failed to lead to the privacy policy.We conduct a comprehensive comparative study between all app categories in terms of the content of the provided policy link, the error links, and the non-English links.We present the App Privacy Policy Corpus (APPC-451K), the most extensive App privacy policy corpus available in the literature. It consists of over 451K English privacy policy documents. APPC-451K will be available for the research community and can be used in further analyses or in machine learning experiments to produce useful information from, and relating to, privacy policies.In this study, we make the following contributions:This study is aware of several previous studies investigating the status of the privacy policies in the app stores ecosystem and constructing privacy policy corpus. Our work transcends the preceding work by investigating a vast number of apps in the iOS App Store and building a larger privacy policy corpus.The majority of the existing studies have examined a relatively small number of apps from quite a few different app categories. Authors in  assessedFocusing specifically on apps related to financial services, the authors in this study  performeFinally, and probably closer to our work,  conducteTypically, using Machine Learning (ML) techniques in text mining requires a relevant text corpus. In addition, the supervised learning demands a highly qualified annotated dataset to inform the model construction. Several studies reported using a privacy policy corpus when applying ML to privacy policies ,29,30. HOn the other side, The Usable Privacy Policy Project UPP  is an inThe App Privacy Policy Extractor APPE is a system that has been developed to facilitate our research. APPE was designed to serve three primary purposes: (1) assessing the incidence of privacy policies of the apps across the store; (2) analysing the content of every purported privacy policy link posted within apps’ pages; and (3) collecting the verified privacy policy document and constructing a comprehensive privacy policy corpus. The APPE pipeline involves three primary components: (a) an app store crawler, (b) a policy links scrapper, and (c) a privacy policy recogniser (PPR) system. An overview of the different components in our system is illustrated in The app store crawler is functioning by forming the categories and capturing apps metadata within each app category, and acquiring alleged privacy policy links of every app.Typically, apps are structured into different categories within app stores  where developers can conveniently classify their apps. In this study, we have discovered twenty-four different categories in the iOS app store. Each category has two layers for classifying the apps; an alphabet layer consists of A-Z letters and a numeric layer for each alphabet. For example, the ‘Instagram’ app belongs to the ’Social Networking’ category and is categorised under the letter ’I’, but due to the large number of social networking apps having their names start with ‘I’, ‘Instagram’ categorised under numeric layer number 8, within the ‘I alphabet layer. The app store crawler starts by acquiring the categories of the apps first. Next, it grabs the first letter in the alphabet layer and the first number in the numeric layer under that specific letter. After that, it captures the app’s metadata, stores their information, and continues the process iteratively. By the end of this phase, information from over two million unique apps , listed into 24 different categories, had been obtained.After composing the categories and obtaining all the apps’ information, the system then searches for the privacy policy link in the designated place within each app page. In order to identify the links of the privacy policies of the apps, we search the relevant URLs in the HTML element dedicated to privacy policies by the iOS App Store guidelines. If the HTML element contains a ‘href’ link labelled “privacy policy” it will be identified as a potential privacy policy URL. If the privacy policy link is provided, we classify the app in the (Apps provided Link to Privacy Policy) regardless of the content of the page, as it will be evaluated in a later phase. If the link is missing, the app will be classified as (Apps did not provide Link to Privacy Policy). Some apps return errors while crawling the store, which is probably due to its removal by the app developer or app store. Hence, any app that was not available at the time of crawling has been categorised as (App not available in-store).This component is responsible for following the links to allegedly privacy policies, determining their validity , and downloading the content associated with them. It utilises the Python Requests library to determine the validity of the links, and the real headless Google Chrome browser to scrape and download the contents of web pages. The advantage of using the real web browser over using the HTTP requests option is that it allows the content of the page including the JavaScript dynamically viewable content to be captured. We designed this component with the ability to handle the documents posted in HTML pages or posted in PDF, Microsoft Word , and txt format. We confirmed this with a number of randomly chosen policy’s links from all the 24 categories. We compared the Policy Scrapper results to content produced by the manual navigation of the same policy links. We found that the Policy Scrapper successfully scrapped all the content of the web pages, including the dynamically viewable elements.The Policy Scrapper starts by checking if the link directs to a valid domain name first; if not, the link is categorised as a DNS Look Up error. Next, it checks the HTTP response status code. If the link returns a code other than 200 OK, the link is classified based on the error code it returned, such as: (a) 403 Forbidden (access denied), (b) 404 Not Found, and (c) 500 .If the Policy Scrapper returned the HTTP 200 OK success status response code, which indicates that the request has succeeded, the system proceeds with parsing the entire content of the web page into plain text and checking the language of the page. If it is in English, it is sent to the Privacy Policy Recogniser PPR component to determine whether it is a privacy policy. If it is not in English, it is labelled as a non-English document. To determine the language of the documents we utilised an off-the-shelf Python package Langid . Langid To tackle the challenge of deciding whether each of the provided links leads to a valid privacy policy, we developed the Privacy Policy Recogniser PPR. The PPR is a core component in APEE, based on the Deep Learning DL approach. It is capable of broadly determining whether or not the submitted documents by app developers are English-language privacy policies on a large-scale. The two core components used to develop PPR model classifiers are LSTM and CNN, where LSTM captures the words correlation by treating the data as sequences, and CNN, in contrast, treats the data as chunks (sentences) sharing similar contextual correlation. We employed Glove  as a preIn addition to CNN and LSTM, the core DL algorithms that we used to develop PPR, we also employed two variations of the core DL methods, namely, RCNN and LSTM-Attention.The LSTM-based classifier used in our experiments consists of two LSTM layers followed by a dropout layer to alleviate overfitting. The last layer is a fully-connected layer that maps the output of the last hidden layer in the sequence to an output of size 2, which represents the policy and non-policy classes. In the LSTM-attention classifier, we incorporated an attention mechanism on top of the LSTM-classifier . This adWhen we developed the CNN-based classifier, we based it on the CNN sentence classifier proposed in . The maiIn order to build a robust and accurate policy recogniser model, we developed several DL models and put them through extensive testing. We compared the performance of all models in all performance metrics, specifically: (a) accuracy, (b) recall, (c) precision, and (d) F-1 scores. The models with the best results were adopted.As shown in Due to the supervised nature of our approach, a labelled dataset becomes a critical component of training and testing our deep learning techniques. As a result, we have manually created and labelled a dataset consisting of 9600 documents that had been divided into two categories: privacy policies and non-policy documents. The corpus used in developing the DL classifiers was manually created by the authors. We navigated through the downloaded English documents and searched and collected 200 privacy policies from each app’s category, resulting in 4800 privacy policy documents. In the same way, we manually collected 200 random non-policy documents from each category of apps. As a result, the final corpus contained 9600 policy and non-policy documents, which later were divided into a 80:20 ratio for training and testing purposes.In this section, we present the results of our store-wide evaluation of the distribution of the privacy policies and the investigation of the contents of the provided links. App developers are explicitly required to include privacy policy links on the designated app pages on Apple’s App Store platform . DespiteBased on our analysis, out of over two million crawled app metadata 1,176,912 apps, representing 58.5% of the crawled apps, provided links to their privacy policies. In contrast, 789,463 apps representing 39.3% did not provide links to their privacy policies. In addition, only 44,020 apps, which represent 2.2 percent of the total apps, were unavailable at the time of the crawl. We believe this omission may be due to removal of the apps by the App store or the app publishers. Though we evaluated the presence of privacy policies’ links on a much larger number of apps on the Apple iOS App Store, our result is broadly consistent with findings from a previous study, which showed that about 49% of apps did not provide links to privacy policies within the Google Play Store . This reHerein we present the results of investigating every purported privacy policy link. This process is done through two components of APPE, namely: (i) the Policy Scrapper and (ii) the Privacy Policy Recogniser. The details of the investigation into every app category is reported in Our results show that 26.2 percent of the provided links by apps in the different app categories returned connection errors when followed. In total, 56 different types of errors were encountered by our system. We found that the 404 Not Found error is the most common error, which was encountered more than 124K times, followed by the DNS Lookup error that has been exhibited by over 113K links. Both 404 and DNS Look UP errors constitute nearly 10% and 9% of the total provided links and nearly 40% and and 36% of the links that returned errors, respectively. Timeout and the 403 Forbidden errors were also encountered frequently, as over 35K links returned timeout and over 20K links returned the 403 error. These types of errors also represent a relatively big portion of both the total number and the error class of links. Additionally, our system encountered many server-side errors, such as 500  503 (service unavailable) and many different other errors. Since we are conducting our experiments in the UK, it is intuitively expected that the apps’ privacy policies will be written in English. Therefore, in this study we are only interested in the English privacy policies. After filtering out the non-English documents, we ended up with 651,430 English documents and 217,633 non-English documents representing 56.9% and 16.9% of the provided links respectively. As a matter of interest, our system identified 95 different languages, some of which appeared thousands of times while others appeared only a few times. As can be seen from One of the other noticeable results produced by our system is the prevalence of links leading to non-privacy policy documents. The non-privacy policy provided links representing 16.9% of the total provided links. By analysing the content of the non-privacy documents, we found that most of the contents can be divided into three groups. First, the developer and the owner of the app homepages, where the provided links direct the users to the homepages of the organisation or the individual that owns the app. We should emphasise that we are not suggesting that these homepages lack links to privacy policies; rather, we believe that the provided link in the designated place for the privacy policy link should lead directly to the privacy policy, as required by the App store. This option is preferred to adding yet another burden on the user by requiring them to search for privacy policy links within the home pages. Additionally, it is most likely that the policies on the homepages are intended to cover the websites they are posted on. It should be noted that the Apple App Store has dedicated a specific location within the store listing for app developers to provide links to their homepages. Therefore, app developers posting their homepages into the element designated for the privacy statements may not even consider describing their app’s privacy practices. The second group is the irrelevant content, since numerous links are directed to web pages that contain short messages  or inappreciable content. The last group is the empty content, where the links lead to web pages that contain no content to view.At the final stage, our APPE system has verified 451,882 privacy policy documents, a number which constitutes 38.4% of the total provided links. Hence, we call this large corpus of policy documents the App Privacy Policy Corpus (APPC-451K). It consists of over 451K policy documents from 24 different app categories. The privacy policies in our corpus have an average sentence count of 68 sentences per policy and an average of 26 words per sentence. They also have a mean policy length of about 1845 words per policy, and standard deviation of about 1668. The word count of the policies in this corpus ranges between 8k and 22k words. Yet, we intend to conduct a more comprehensive analysis on the content of the corpus in future work. The App Privacy Policy Corpus APPC-451K will be released for further research under the creative commons license.In the previous section we outlined a broader analysis of the store-wide distribution of privacy policies. In this section, we aim to provide insightful information about the policies in every app category. We present our analysis of the results of comparing the different app categories in terms of: (a) availability of privacy policies links, (b) verified privacy policies, (c) non-policy contents, and (d) the encountered errors.As mentioned earlier in the paper, about 58 percent of over 2 million apps provided links to a privacy policy. Yet, since our system discovered 24 different app categories in the store, it is interesting to explore the availability of privacy policy links in every app category. This initiative will highlight the categories that have less availability of policy link access, which might help users to pay more attention when downloading apps from these categories.As displayed in As discussed in the previous subsection, the majority of apps in the various categories have provided links to policies. Nevertheless, our examination of these links reveals that, when followed, not all of them lead to privacy statements. Our results show that out of 24 different app categories, only one app category, namely, Magazine&Newspaper has above 50% of its apps policy links actually leading to privacy policies and only about 5% leading to non-policy documents. Despite that, the percentages of broken links (22%) and links leading to non-English pages (17%) are still relatively high. One possible reason for this specific category to have a higher percentage of providing policy links (see the above subsection) and availability of actual policies than when compared to the other categories, is that magazines and newspapers are usually run by companies that have the resources  needed to ensure the availability and compliance of privacy policies with the relevant laws and regulations.As noted in Apple has heavily invested to show itself as a privacy-centric company, a stand which gives it an advantage in the market. This research is intended to challenge the previous statement and answer questions related to the status of the privacy policy in the popular Apple iOS App store. The result of our research confirms that Apple is not different from Google when it comes to privacy policy status in their app stores. Neither company enforces systematic reviews of apps’ privacy compliance with the relevant regulatory rules. These rules mandate the requirement of providing real privacy policies describing the actual privacy practices performed by the apps. Instead, both companies allow developers to submit alleged policy links without verifying whether it is a valid link or if it actually leads to the privacy policy. The privacy situation in Apple iOS App Store seems to be a little bit better than Google Play store in terms of providing privacy policy, as the prior work on Google Play store (1 million apps)  shows thDue to the fact that no previous researchers have conducted similar investigations to ours, in terms of assessing the privacy status in the entire app store, and comparing all the different app categories, the chances of comparison are quite limited. In response to the second question, as we reported in the results section, the majority of the purported privacy policies links did not actually lead to real privacy policies when followed. As a matter of fact, providing a broken link or putting a URL leading to the home page of the app’s owner in the designated place for the privacy policy, instead of putting it in the designated place for the homepage, raises a serious question about the consideration of users’ privacy by the app developers. This situation may indicate that the app developers have not considered writing a privacy policy describing the practices followed by their apps. In addition, without a privacy policy, neither users nor the experts in the field would know what information is collected by the apps and how it is handled and used, not to mention any rights the users may have. Lastly, we found that a considerable number of links have led to non-English web pages. It is worth noting that we do not count the non-English documents for the unavailability of privacy policies as the policies might be written in non-English. However, this language issue is not a major problem as we are only interested in studying the availability of English privacy policy documents, since we are conducting our research in a country that has its vast majority of people speaking native English.Furthermore, our comparison between the different app categories, in terms of the availability of privacy policy links, shows a clear differentiation between the app categories when it comes to providing links to the privacy policy. For the app categories that have the highest number of apps offering a link to a privacy policy, in particular, Magazine&Newspaper, Finance, and Social Networks, the presence of a link to the company’s privacy policies may play a role in building trust with users and lending credibility to the companies, which is essential for companies in this field. On the other side, users of Games and Entertainment apps, the categories with the greatest number of apps lacking a privacy policy, may be less concerned about privacy or may not have a concept of privacy at all, if we consider children users. Moreover, apps in these categories may not require sensitive information to be provided in contrast to other apps such as Social Networks apps.Interestingly enough, our research suggests that, in general, if a user downloaded an app from the Apple App Store, it is likely that the apps will provide a privacy policy link. What is important, however, is whether or not this link leads to a privacy statement. Our analysis shows that the overall likelihood that the link provided by any app would take its user to a privacy policy is low; thus, it is unlikely that the link will go direct to a privacy policy page. Although there is a significant chance these links leading to privacy policies may vary from one app category to another, the probability of finding/connecting with privacy policies is low in all app categories.In this study, we tackled one of the concerning matters in App stores, the privacy policy. We first introduced the App Privacy Policy Extractor APPE, the system that crawled the entire iOS app store and retrieved the metadata of over two million apps. Our analyses of the metadata showed that more than a third of apps have no privacy policy links and nearly two-third of the apps have provided unverified privacy policy links. After following and examining the content of every provided link to the privacy policy, we found that a substantial number of the links were, in reality, invalid. We also found that a considerable proportion of the links also led to non-policy web pages and non-English pages. Furthermore, from the verified privacy policy links, we constructed the APPC-451K, the most extensive app privacy policy corpus in the literature. It consists of over 451K privacy policy documents. The corpus will be available for the research community to be used for further analysis of apps’ privacy policies using machine learning or other NLP techniques.


How to learn the embedding vectors of nodes in unsupervised large-scale heterogeneous networks is a key problem in heterogeneous network embedding research. This paper proposes an unsupervised embedding learning model, named LHGI . LHGI adopts the subgraph sampling technology under the guidance of metapaths, which can compress the network and retain the semantic information in the network as much as possible. At the same time, LHGI adopts the idea of contrastive learning, and takes the mutual information between normal/negative node vectors and the global graph vector as the objective function to guide the learning process. By maximizing the mutual information, LHGI solves the problem of how to train the network without supervised information. The experimental results show that, compared with the baseline models, the LHGI model shows a better feature extraction capability both in medium-scale unsupervised heterogeneous networks and in large-scale unsupervised heterogeneous networks. The node vectors generated by the LHGI model achieve better performance in the downstream mining tasks. Embedding learning based on heterogeneous networks can integrate multi-dimensional heterogeneous information in the network and generate node vectors with rich semantics. The supervised embedding learning models can optimize the parameters in the model with the help of supervision information, and extract the features in the network to encode the nodes ,2,3. HowVarious unsupervised embedding learning models have been proposed to encode nodes in heterogeneous networks, such as the models based on random walk ,5,6, Gen(1)LHGI is an embedding learning model designed for large-scale heterogeneous networks. LHGI adopts the graph sampling strategy under the guidance of metapaths, so that the model can compress the network while preserving the low-order and high-order neighbor relationships between nodes as much as possible. This provides a guarantee for the model to generate high-quality node embedding vectors.(2)LHGI is an unsupervised embedding learning model. LHGI introduces the idea of contrastive learning, which enables LHGI to optimize parameters in the model, so that the embedding vectors of nodes can be learned without any supervision information.In this paper, we propose a large-scale heterogeneous network embedding learning model LHGI  based on metapath graph sampling technology. LHGI maps the initial large-scale heterogeneous network into a series of homogeneous graphs under the guidance of metapaths. Each homogeneous graph reflects the neighborhood relationship between nodes on a certain metapath. LHGI generates the sampling graphs by executing an iterative sampling strategy on the homogeneous graphs. Because the information extracted from different metapaths is integrated in the sampling process, the sampling graph obtained can integrate the low-order and high-order semantic relationships between nodes in the initial heterogeneous network, thus avoiding the loss of information in the network as much as possible. Then a contrastive leaning process is conducted to generate the embedding vectors of nodes in the network. The main contributions of LHGI model are as follows:Researchers initially introduced random walk technology to solve the unsupervised problem in network embedding. By executing random walking in the network, a series of node sequences are generated, which are input into the skip-gram model to generate the embeddings of nodes in the sequence. Following this strategy, Deepwalk , Node2veHowever, the above models are proposed for unsupervised embedding learning tasks in homogeneous networks. Heterogeneous networks contain a variety of relationships between nodes of different types. This makes the information transmission between heterogeneous nodes more complex, and also makes it difficult to directly migrate the learning models suitable for homogeneous networks to heterogeneous networks. Many embedding learning models were proposed for heterogeneous networks, where metapaths have been leveraged by most of the existing works on heterogeneous network modeling .Researchers designed metapaths based on node types and their relationships to guide the process of random walk. For example, the Metapath2vec model , HERec mIn order to deal with the problem of high space and time complexity caused by the growth of network size, researchers proposed graph sampling technology. For homogeneous networks, the GraphSAGE model  was propIt can be seen that researchers have made in-depth explorations on the node embedding task in unsupervised heterogeneous networks. However, these explorations are only applicable to medium-scale heterogeneous networks, and it is still difficult to directly migrate them to large-scale heterogeneous networks. Although graph sampling technology can compress the size of the network, it can only sample the local substructure of the target node. In other words, this technology can only obtain the low-level neighbor relationship of the target node, which leads to the loss of higher-order semantic information in the network, thus ultimately limiting the performance of node embedding.In this paper, we propose an unsupervised embedding learning model, LHGI, for large-scale heterogeneous networks. LHGI uses a graph sampling technology guided by metapaths to compress the size of network. Compared with the existing graph sampling technologies, the metapath guiding graph sampling technology can capture low- and high-order semantic information in large-scale heterogeneous network. At the same time, LHGI uses the idea of contrastive learning to optimize model parameters, which enables the model to learn the embedding of nodes without supervision information.Definition 1: Heterogeneous networkA heterogeneous network is a graph composed of different types of nodes and different types of edges between nodes. Formally, a heterogeneous network can be defined as Definition 2: MetapathA-P-A” can be labeled as In a heterogeneous network, a metapath is a path composed of a sequence of relationships between heterogeneous nodes. Formally, a metapath There is a unique one-to-one correspondence between the adjacency matrix and the topology of the network. Through the progressive multiplication of adjacency matrices, a series of metapaths is automatically generated. In order to exclude redundant and low semantic metapaths, four screening principles are designed in this paper.Principle 1: In one metapath, up to two nodes in a certain type can exist.Principle 2: In one metapath, up to three different types of nodes can exist.Principle 3: Metapaths containing a subpath with 1:1 relationship between its head and tail node will be excluded.Principle 4: Only metapaths with the same type of head and tail nodes are retained.Principle 4 is set to preserve the metapath adjacency relationship between homogeneous nodes. If the head and tail nodes belong to different node types, the adjacency semantic relationship between them is complex and difficult to explain. Therefore, only the metapath adjacency relationship between homogeneous nodes is retained.Based on the four principles, the metapaths that meet the requirements are screened out. Then the relationship between the head and tail nodes in the metapath is extracted and mapped into a homogeneous graph. A metapath maps to one homogeneous graph. The homogeneous graph can well preserve the information transmission between homogeneous nodes on a specific metapath, and can preserve the low-order or high-order semantic information in the heterogeneous network according to the different lengths of metapaths.In order to deal with the high space-time complexity in training a large-scale network, this paper designs a graph sampling module in LHGI. Unlike the existing sampling techniques, which directly sample the local substructure in network, the graph sampling process proposed in this paper is based on the homogeneous graphs mapped by the metapaths. In the homogenous graph, the adjacency relationship between nodes actually reflects the information transmission between the head and tail nodes in the metapath. The sampling process based on the homogenous graph can retain the semantic information of nodes on the metapath, rather than the first-order adjacency relationship in the initial heterogeneous network. According to the different lengths of metapaths, graph sampling based on metapaths can retain low and high order semantic information between nodes in the network. Therefore, compared with the strategy of directly sampling the neighborhood substructure of the target node, the graph sampling strategy under the guidance of metapaths proposed in this paper is more helpful to retain the higher-order semantic relations in the network, so as to avoid the loss of information caused by the sampling process as much as possible.For all the nodes in the homogeneous graph, the resampling method is used to sample a fixed number of neighbor nodes for each node. For target node GCN can capture the local topology characteristics of nodes in the network without prior information, so GCN is used to learn the embedding vectors of nodes in this paper. For each sampling graph, GCN encodes the target node by aggregating the information of its “neighbors”. The neighbors here are no longer the first-order neighbors of the target node in the initial heterogeneous network, but the higher-order neighbors determined by the head and tail relationship in the metapaths. And because the sampling graph is obtained by sampling the metapath many times, the sampling process can approach the deeper semantic information contained in the initial heterogeneous network as much as possible. The formula of GCN is as follows:A given node may appear in different metapaths, which means that one node will obtain different embedding vectors. Here, the semantic attention mechanism is used to measure the weight of semantic information provided by different metapaths. According to the weights of the metapaths, the node vectors generated by different metapaths are aggregated to obtain the final embedding vector of the node. The following formulas show the aggregation process.At the same time, a Negative Sample Generator is used to generate negative sample nodes by randomly disrupting the rows in the initial node characteristic matrix X, which will disrupt the order of node indexes and destroy the connection between nodes. Then, the same embedding learning process as for the normal sample nodes is performed to learn the embedding vectors of the negative sample nodes. Because the initial characteristics of the negative sample nodes and their adjacent relationships with other nodes are randomly disturbed, the negative sample node vector is not learned on the real network space features. This makes the vector of the negative sample node significantly different from that of the normal node, so the LHGI model can solve the problem of unsupervised training through the idea of comparative learning.Then the vector of global graph is generated by aggregating the local graph vectors calculated in each batch. The local graph vector is obtained by averaging the vectors of nodes obtained from each batch of sampling. Mutual information is often used to measure the amount of information shared between two random variables. Let the mutual information between two random variables Greater mutual information means that the variable  the DIM  model, rThe discriminator The spatial complexity of the LHGI model is mainly determined by the Meta Path Generation Module, Meta Path guided Graph Sampling Module and Sampling Graph Aggregation Encoding Module. The number of metapaths obtained in the Meta Path Generation Module determines the number of GCN encoders required by LHGI. In the Meta Path guided Graph Sampling Module, the number of target nodes processed by each batch, the number of neighbor nodes sampled by each batch and the number of sampling batches are the main factors affecting the input scale of LHGI. In the Sampling Graph Aggregation Encoding Module, LHGI uses a two-layer GCN encoder to avoid the over-smoothing problem in the learning process . SupposeThe time complexity of the LHGI model is determined by the running time of each batch and the number of batches. The number of batches is related to the number of target nodes processed under each batch. The more target nodes processed in each batch, the less batches required, and vice versa. Therefore, the time complexity of the LHGI model can be expressed as For the two large-scale heterogeneous networks given in Taking the AMiner network as an example, when the batch size is 1024, the running time of an epoch is 109.5 s. When the batch size is 131,072, the running time of an epoch is 42.16 s. It can be seen that for large-scale heterogeneous networks, the LHGI model can easily train the network under different batch sizes. In practical applications, the appropriate batch size can be selected according to the hardware environment, which enables LHGI model more universal.To verify the performance of the LHGI model, some unsupervised heterogeneous network embedding learning models are taken as the baseline models to compare with LHGI. These baseline models include the models based on random walk architecture, models based on GAN architecture, and models based on graph sampling architecture. Metapath2vec(M2V) : M2V is Hin2vec : Hin2VecHeGAN : HeGAN iHDGI : HDGI usHGT : The HGT(1)IMDB: IMDB is a movie dataset, which contains three types of nodes, including 4278 movies, 2081 directors and 5257 actors. Among them, movie nodes are divided into three categories: action movies, comedy movies and drama movies.(2)DBLP: DBLP is a citation network dataset, which contains 4 types of nodes, including 4057 authors, 14,376 papers, 20 conferences, and 8920 terms. Among them, author nodes are divided into four categories: database, data mining, information retrieval and machine learning.(3)Yelp: Yelp is a commercial data set, which contains 5 types of nodes, including 2614 business, 1286 users, 2 service types, 2 reservation, and 7 stars levels. Among them, business nodes are divided into three types: Mexican flavor, hamburger type, and food bar.In the baseline models, the random walk process in the Metapath2vec model and Hin2vec model requires higher time consumption and higher storage capacity. The HeGAN model and HDGI model need to learn the embedding of nodes in the initial heterogeneous network. When there are too many nodes in the network, the training cost of these two models will increase exponentially, which will lead to memory overflow and terminate the training process. Therefore, these models cannot be well applied to the learning tasks of heterogeneous networks with millions of nodes. Therefore, three relatively moderate data sets are selected to build heterogeneous networks, so that all models can be trained on these heterogeneous networks. By comparing the classification performance of the node vectors generated by each model on three datasets, the effect of embedding learning of the models is evaluated. The information of the three datasets is as follows:At the same time, two large-scale heterogeneous networks with millions of nodes are used to discuss the capability of the LHGI model in learning tasks under unsupervised large-scale heterogeneous network.(4)AMiner: AMiner is a large-scale heterogeneous citation network, which contains 4,888,069 nodes in total. These nodes are specifically divided into 134 venues, 1,693,531 authors and 3,194,405 papers. The author nodes are divided into eight types in AMiner.(5)ogbn-mag: ogbn-mag (Open Graph Benchmark Node Property Prediction-Microsoft Academic Graph) is a heterogeneous graph composed of a subset of the Microsoft Academic Graph. It contains four types of entities, including 736,389 papers, 1,134,649 authors, 8740 institutions, and 59,965 fields of study. The paper nodes are divided into 349 types according to the venue  of each paper.One-hot encoding is used to encode the initial features of nodes. The upper limit of the number of neighbors of each node in the sampling process is set to 20, and the sampling iteration number As shown in In order to verify the performance of node embeddings learned from different models, the KNN algorithm is used to classify the labeled nodes in each dataset. In order to verify whether the node vectors learned by LHGI model can achieve similar classification performance on other classifiers, the experimental results of the SVM and MLP classifiers are given. In the LHGI model, the Discriminator Module adopts the idea of contrastive learning. By destroying the initial characteristic matrix of nodes, LHGI generates negative sample nodes. The lower bound of the mutual information loss function is approximated by the NCE loss between the normal/negative node vectors and the global graph vector with a contrastive learning process, which solves the problem of how to train the model with unsupervised information. At the same time, the metapath guided graph sampling technology proposed in LHGI model can aggregate the semantic information in the metapaths. This enables LHGI model more effective in preserving low-order and high-order semantic information in the network, so that it can learn node vectors with better classification performance.Among all the baseline models, only the HGT model is proposed for the embedding learning of large-scale heterogeneous network. In order to compare the embedding effects of the HGT model and LHGI model on large-scale heterogeneous networks, the classification performance of the vectors generated by the two models was analyzed. The Softmax function of MLP was used to achieve the classification results. The HGT model directly samples the local structure from the initial heterogeneous network, which makes the learning process depend only on the sampled local substructure. The LHGI model adds the guidance of the metapath relationship in the sampling process, which can help preserve the higher-order and deeper semantic relationships in the network as much as possible. Therefore, compared with HGT model, LHGI can reduce the loss of semantic information in the network as much as possible. This enables the node vectors learned by the LHGI model to contain richer semantic information, so as to better perform the downstream mining tasks.In order to solve the problem of embedding learning in unsupervised large-scale heterogeneous networks, this paper proposes an embedding learning model, LHGI, based on metapath guided graph sampling. The LHGI model consists of the Meta Path Generating Module, Meta Path Guided Graph Sampling Module, Sampling Graph Aggregation Encoding Module and Discriminator Module, which respectively perform the tasks of automatically generating metapaths, graph sampling guided by metapaths, node (graph) encoding and maximizing the mutual information. To solve the problem of embedding learning in large-scale heterogeneous networks, the LHGI model adopts the strategy of graph sampling under the guidance of metapaths to compress the size of the network. Metapaths themselves are structural sequences in the network, which contain rich semantic information. The graph sampling process based on metapaths can realize the iterative fusion of the semantic information in metapaths. This process enables the LHGI model to capture the local and global semantic information in the heterogeneous network as much as possible, thus reducing the loss of information as much as possible. In order to solve the problem of embedding learning without supervised information, the LHGI model adopts the idea of contrastive learning. The LHGI model generates some negative sample nodes by scrambling the characteristic matrix. The loss function of the LHGI model is set by maximizing the mutual information between vectors of normal nodes and the overall graph, and minimizing the mutual information between vectors of negative sample nodes and the graph, so that the model can be trained even without supervised information. Experimental results show that the LHGI model is well qualified for embedding tasks on large-scale heterogeneous networks with millions of nodes. At the same time, the LHGI model is also suitable for learning tasks on medium-scale heterogeneous networks. Even without supervised information, the LHGI model successfully completed the task of network feature extraction. The node vectors learned by the LHGI model perform well in the downstream mining tasks.In this paper, the classification and clustering tasks are used to verify the performance of the node vectors learned by the models. In fact, in addition to these tasks, the LHGI model can also be applied to other downstream mining tasks, such as the link prediction task, which is used to determine the possibility of connecting edges between two nodes . On the At the same time, a heterogeneous network is actually a special case of hypergraph. In a heterogeneous network, one edge can only connect two nodes, while in a hypergraph, one edge can connect multiple nodes. This makes the embedding learning process in hypergraph more complicated than that in heterogeneous network ,34. In a


DNA methylation is an important mechanism involved in bacteria limiting foreign DNA acquisition, maintenance of mobile genetic elements, DNA mismatch repair, and gene expression. Changes in DNA methylation pattern are observed in bacteria under stress conditions, including exposure to antimicrobial compounds. These changes can result in transient and fast-appearing adaptive antibiotic resistance (AdR) phenotypes, e.g., strain overexpressing efflux pumps. DNA methylation can be related to DNA mutation rate, because it is involved in DNA mismatch repair systems and because methylated bases are well-known mutational hotspots. The AdR process can be the first important step in the selection of antibiotic-resistant strains, allowing the survival of the bacterial population until more efficient resistant mutants emerge. Epigenetic modifications can be investigated by third-generation sequencing platforms that allow us to simultaneously detect all the methylated bases along with the DNA sequencing. In this scenario, this sequencing technology enables the study of epigenetic modifications in link with antibiotic resistance and will help to investigate the relationship between methylation and mutation in the development of stable mechanisms of resistance. The discovery of antibiotic compounds has revolutionized the way in which we face infectious diseases: antibiotic drugs have saved several lives worldwide, fighting infections that nowadays seem easy to cure, but were not so simple in the past Aminov, . HoweverThe word “antibiotic” defines the application of a compound used to kill or inhibit bacterial growth, more than a specific class of molecules Waksman, . AntibioThus, it seems clear that a resistant strain needs a genetic determinant to overcome antibiotic attack: resistance can originate from mutations or it could be acquired through horizontal gene transfer of mobile genetic elements  have been observed: resistance phenotypes not clearly associated with specific genetic determinants, such as mutations or gene presence/absence.AdR is defined as the ability of the strain to temporarily withstand antibiotic presence, achieved by changes in gene or protein expression  the survival rates were too high; (ii) the resistance MIC increased with the antibiotic concentration; (iii) the reverting frequency after antibiotic removal (around 50%) was too high for a genetic-mediated mechanism (i.e. mutation or resistance genes). These results and the investigation of differential gene expression on resistant strains led the authors to propose that the observed resistance phenotype was due to epigenetic regulation  Cheng, . The metWhen the methyltransferase fails to methylate a motif, it produces a hemimethylated position. This can cause the unmethylation of that site in the daughter cells, after DNA replication. This effect occurs because during DNA replication methyltransferases use each strand as a stamp for the methylation of the newly synthesized DNA daughter strands. Thus, the motif on the methylated strand will be inherited as methylated, while the other as unmethylated  and the other lacking these paired enzymes   systems  that involve a cysteine desulfurase (DndA), an iron–sulfur cluster protein (DndC), a protein with ATPase activity (DndD), a protein that binds nicked dsDNA (DndE) and DndB, that seems to be not essential for PT modification   is a chemical modification of the DNA that occurs not on bases, like methylation, but on DNA backbone: it is the substitution of a non-bridging oxygen on the phosphodiester bond with a sulfur atom  is associated with groESL-2 upregulation in V. cholerae and a greater survival rate under aminoglycoside stress. The same effect has been observed in wt V. cholerae strains, when the 5′-RCCGGY-3′ motifs in the groESL-2 region are unmethylated , where phenotypic changes are still reversible, to a Slow and Stable Mechanism (SSM)  are mutational hotspots in  Cherry, . As statSalmonella enterica Type III RM system in the motif 5′-CAC4mCGT-3′ increases the transversion rate from the methylated cytosine to adenine by 500-fold.The authors also found a similar mutation bias for the motifs of the other RM methyltransferases. In another work, Cherry  showed hDespite the importance of AdR and epigenetics in the emergence of antibiotic-resistant strains, these mechanisms remain poorly investigated. Among the reasons, the lack of suitable techniques to detect methylated bases is likely one of the main. Recently, the development of third-generation sequencing machines revolutionized the field allowing the precise identification of methylated bases. The main sequencing-based methods available for the analysis of DNA methylation are, namely, bisulfite sequencing, restriction enzymes–based mapping and third-generation sequencing (SMRT and Nanopore) .Bisulfite sequencing technology . This method is reliable but useful only if the restriction motif is known, and if methyl sensitive and insensitive specific restriction enzymes exist for that motif  and of the other modified bases of the DNA, along with the simultaneous detection of the nucleotide sequence. Two platforms are available for the detection of modified bases on a genomic scale  DNA has to be extracted from fresh samples; (ii) the high error rate of SMRT and Nanopore sequencing could include errors in the methylation analysis; and (iii) gold standard data analysis algorithms and software still lack.Single Molecule, Real-Time (SMRT) sequencing can detect, with different sensitivity, all the main modifications of the DNA: it allows an optimal detection of 4 mc and m6A, but for 5 mC it requires additional steps, such as TET conversion or very deep sequencing coverage . This system works on a membrane filled with nanopore proteins, immersed in an electrolyte solution on which a voltage current is applied. When the single-strand DNA template passes through the nanopore protein, a nucleotide-specific electric alteration is produced and registered  allow us to investigate the link between methylation and mutation. On the other hand, third-generation sequencing data could be combined with RNA-seq or microarray experiment results to study the role of fast gene expression modulation in the emergence of antibiotic-resistant strains. Methylation analysis can be also useful to identify distant regulatory regions or secondary DNA structure that can prevent gene transcription and to correlate methylation patterns with different gene expression also in resistant strains. Exploring the epigenetic mechanism beyond the antibiotic resistance could also lead to the discovery of novel pharmacological targets, perhaps not subject to selective pressure and that could not lead to the development of new antibiotic resistance mechanisms.Epigenetic mechanisms in bacteria are still not fully understood, and the studies performed until now have only scratched the surface of the problem. This knowledge gap in such an important process can strongly limit our ability to understand the mechanisms beyond the emergence of antibiotic-resistant nosocomial pathogens.E. coli by the knockout of methylation-associated genes, rather than focusing on the identification of methylated DNA bases. The study of the expression of genes involved in DNA methylation in E. coli during the early stages of exposure to antibiotics could help to highlight the pathways involved in this mechanism. Third-generation sequencing technologies directly collect methylation information during the DNA sequencing process, allowing us to investigate the relationship between methylation and mutation. In the future, improvements in standardization of methylation experiments and in sequencing data analysis will be pivotal to obtain more robust and comparable results.Most of the experimental studies on DNA methylation have been carried out on SPap performed the review of the literature, wrote the manuscript, and prepared the figures. AA, RN, and SPan performed the review of the literature. IB conceived the idea. FC conceived the idea and wrote the manuscript. All authors contributed to the article and approved the submitted version.The authors declare that the research was conducted in the absence of any commercial or financial relationships that could be construed as a potential conflict of interest.All claims expressed in this article are solely those of the authors and do not necessarily represent those of their affiliated organizations, or those of the publisher, the editors and the reviewers. Any product that may be evaluated in this article, or claim that may be made by its manufacturer, is not guaranteed or endorsed by the publisher.