# Democratizing Deep Learning Applications in Earth and Climate Sciences on the Web: EarthAlHub
## 2 Materials and Methods
### System Modules
#### 2.3.2 Model Management Module  
The Model Management Module in the platform manages model creation and access to those models. While anyone can run any of the models approved by an admin on the app, only registered users can create a model. Full database specifications of a model can be seen in Table 17 in the Appendix.  
**Model Creation:** A user should input the necessary information about the model they are submitting alongside the necessary model files, i.e., the archive file of the TensorFlow.js GraphDef model and the config.json file that we have described earlier. As for the information the user provides regarding the model, EarthAIHub asks for a name, a description of the model, some brief information about the input and output that the model expects and delivers, and finally, an optional extended information text to include any relevant links and publications. Once a user fills out the form and submits it, the client-side Model Management Module makes a POST request to the server side with all the information and files provided and attaches the JWT access token to that request. The server-side aspect is straightforward; both files are saved in the static file directory of the platform with random hexadecimal names, and both unarchived and archived versions of the model are stored. After that, the paths to the saved files and the model information, along with the submitting user's identity, are saved to the database.  
**Models Page:** The Models page is an interface where everyone can see all submitted and approved models, whether they are logged-in users or not. Once a user reaches the Models page, the client-side Model Management Module makes a GET request to the server-side Model Management Module without an authorization header. Those models are returned to the client side without actual model files but with their paths in the app. This way, the burden on both the server-side and client-side steps is minimized because model files should only be downloaded to the client side when needed, which is not until a client decides to try out a model on EarthAIHub.  
**Individual Model Page:** On EarthAIHub, each model has its own page accessible through the Models page. To facilitate running models, the platform's Model Management Module renders an input box according to the submitted config on the model page, and, for the same purpose, a button to run the model and a selection box that allows users to select which backend they want to use to run the model (either CPU or WebGL) are visible. Once a user runs the model after choosing their input file or typing in the input, the Compute Module that will be described below takes over, and once it is finished running, the Model Management Module renders the output on the model page according to the config file. On the Individual Model Page, the owner of individual models finds a link to edit their submission. The editing interface is similar to the model submission interface with minor differences; a user must describe the changes in an external text box to ease administration. Once an edit is submitted, the model is again saved as _is_approved = 0_ and needs the attention of an admin.