# Let's start MANUFACIA 1
## MANUFACIA workflow
```{image} media/Manufacia_Workflow.png
:width: 800px
:name: img_manufacia_worklow
```
```{note}
1. Use CSV format checker. For more information, see [CSV format checker user manual](../csv_format_checker/index_1.html#what-is-csv-format-checker).
2. See [Set tags](#set-tags) for how to add tags.
```
## Select an account
Select one of the accounts to use.
```{image} media/Account_Selection.png
:width: 800px
:name: img_account_selection
```
If there is no lab registered, click [START] in the following screen. If there is any lab available in the account, lab list will be displayed.
```{image} media/welcome.png
:width: 800px
:name: img_welcomme
```
```{caution}
Once you select an account and create the Lab, the selected account will be used until you log out.
```
If you want to switch accounts, log out first and then select the one you want.
To log out, place the mouse pointer over the arrow of account name on top right, then click [Logout].
```{image} media/Account_LogOff.png
:width: 800px
:name: img_account_log_off
```
## Create a lab
Enter the Lab name (required) and the summary (optional).
As soon as the lab name has been given, [Next] button will be enabled. Click [Next] after confirming if there is no input missing.
```{image} media/Create_Lab.png
:width: 500px
:name: img_create_lab
```
The screen automatically proceeds to the next, make sure that the Lab has been created.
```{image} media/View_LabList.png
:width: 600px
:name: img_view_lab_list
```
To create any further labs, just click [+ Create New].
```{image} media/Create_NewLab.png
:width: 600px
:name: img_create_new_lab
```
(register-assets)=
## Register assets
### Select data files
Click [Assets] of the Lab where you want to create assets.
```{image} media/Create_Asset.png
:width: 600px
:name: img_create_assets
```
Now, we're going to add new assets. Choose one of two approaches below, you can mix both to create the same assets.
- Create new from folder
- Create new from file
#### Create new from folder
Click [Create new from folder]
```{image} media/Create_Asset_FromFolders.png
:width: 600px
:name: img_create_assets_from_folders
```
"Drag and Drop" or "Select the Folder" that you want to register.
Here, for example, an 'ok' folder containing 30 normal image data is dragged and dropped and registered.
```{image} media/Create_Asset_FromFolders_DandD.png
:width: 800px
:name: img_create_assets_from_folders_DandD
```
The screen will automatically switch, and make sure that the drag & drop folders are displayed. The folder name and the number of files in the folder are displayed.
```{image} media/Create_Asset_FromFolders_OK.png
:width: 800px
:name: img_create_assets_from_folders_OK
```
```{caution}
Once preview was displayed, **tag assets correctly and press [Add files], before drag & drop the next files or folders**.
If you happened to add a new folder without pressing [Add files], a new tab will be opened. Close the tab first and then go back to the tab you were working to press [Add files].
```
You can add more files or folders after having added files to assets.
#### Create new from file
Click [Create new from file].
```{image} media/Create_Asset_FromFiles.png
:width: 600px
:name: img_create_assets_from_files
```
Drag and drop the file or select the file.
Here, as an example, 30 files of anomalous image data are registered by dragging and dropping. It is also possible to select multiple files at once.
```{image} media/Create_Asset_FromFiles_DandD.png
:width: 800px
:name: img_create_assets_from_files_DandD
```
Check that [New asset] shows the files that you dragged and dropped.
The number of the files that you dragged and dropped are displayed.
```{image} media/Create_Asset_FromFiles_PNG.png
:width: 800px
:name: img_create_assets_from_files_PNG
```
Once preview was displayed, **tag assets correctly and press [Add files], before drag & drop the next files or folders**.
You can add more files or folders after having added files to assets.
```{hint}
Directory structure in the zip file will be fully ignored, its behavior is not guaranteed if there are files with the same name in different directories in the zip file.
```
```{caution}
Zip files cannot be selected with other folders. Tag will not be automatically given by the system, users have to add tag name as same as for the case to select files to create an asset.
```
```{hint}
Creating a zip file using Explorer on Windows10 default environment, file entries will be encoded in SHIFT-JIS and it fails to unzip on MANUFACIA. Therefore it fails to upload datasets. In that case, try one of followings.
1. Avoid using non ASCII letters for filenames.
2. Use zip tool such as 7-ZIP which can encode in UTF-8.
3. Change Windows10 system (Windows locale) setting to UTF-8. **Some other applications can be affected by this change**.
```
(set-tags)=
### Set tags
#### How to use tags
Tag is the group name of a set of assets. Tags are given to a collection of assets. In the case of upload from folder, the set of assets is for each folder. In the case of upload from a file, it is for each file uploaded at the same time. Multiple tags can be set for a collection of assets.
After selecting files, file list will be displayed. For image files thumbnails.
##### Tags automatically assigned
File extension tag will be automatically given.
In the case of a drag-and-drop upload from a folder, the folder name is automatically given as a tag.
```{caution}
If you want to add a different dataset with the same folder name, you must change the folder name beforehand.
```
#### Use of tags
Tags have two main uses.
- For Class Classification
>Tag an asset to a label. In the case of anomaly detection, a tag for linking to a "normal" or "anomaly" label is required. In the case of multi-class classification, a tag for linking to each class (label) is required.
>Uploading from a folder, the folder name is automatically tagged, so it is recommended that the folder name be used as a tag in advance.
- For classification of 'training data' and 'test data'
>There are two methods for classifying 'training data' and 'test data'. See [Split data](./index_3.html#split-data)
>Being selected "Split using Asset Tag", the Tag needs to be set for "Register assets" (Create a new assets). The recommended method of setting up a tag is to assign a prepared "training" tag to the training data and a "test" tag to the test data.
>Registering assets from a folder, the folder must be split into training and test data in advance.
```{caution}
1. For unsupervised learning, "anomaly" datasets will not be divided for training while dividing datasets into for training and for validation in percentage. Therefore, by adding "training" tag to "anomaly", the training will fail. **Tag only "test" to "anomaly" datasets**.
2. Add "training" and "test" tag to the same "normal" datasets will cause training error. Divide datasets into for training and for validation in advance, or **tag only "training" to the "normal" datasets to use "split data by percentage"**.
```
#### How to set tags
The configured tag is highlighted in dark color.
```{image} media/Create_Asset_TagPNG_ok.png
:width: 800px
:name: img_create_asset_tag_PNG_ok
```
Click [+] to add a tag to the asset.
```{image} media/Create_Asset_Create_NewTag.png
:width: 800px
:name: img_create_asset_create_new_tag
```
Create a new tag in need and click [OK].
```{image} media/Create_Asset_Tag_sample.png
:width: 400px
:name: img_create_asset_tag_sample
```
```{important}
Once adding files to asset, the tag setting cannot be changed.
```
(examples-tag-settings)=
#### Examples of tag settings
Tag names other than prepared "training" or "test" tags may be set arbitrarily.
This time, an example of "uploading an asset from a folder" and setting a folder name as a tag name is described.
**Ex.1: Modeling of anomaly detection, when training data and test data are split into "percent"**
| Type of data | Folder | Tagging |
| :------------- | :----- | :------ |
| Normal data | ok | ok |
| Anomalous data | ng | ng |
**Ex.2: 'Training data' and 'Test data' are split using "Asset Tags" during anomaly detection model generation**
| Classification | Data type | Folder | Tagging |
| :------------- | :---------------------------- | :----------------- | :------------------------------------------------------ |
| For training | Normal data
Anomalous data | ok
ng | ok, training*
ng, training* |
| For validation | Normal data
Anomalous data | test_ok
test_ng | test_ok, test*
test_ng, test* |
**Ex.3: For multi-class (4-class) model generation where training and test data are split 'percent'**
| Data type | Label (optional) | Folder | Tagging |
| :-------- | :--------------- | :----- | :------ |
| Class1 | data1 | data1 | data1 |
| Class2 | data2 | data2 | data2 |
| Class3 | data3 | data3 | data3 |
| Class4 | data4 | data4 | data4 |
**Ex.4: Multi-class (four-class) model, in which training and test data are split into "Asset Tag"**
| Classification tag | Data type | Label (optional) | Folder | Tagging |
| :----------------- | :----------------------------------- | :------------------------------- | :--------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------ |
| For training | Class1
Class2
Class3
Class4 | data1
data2
data3
data4 | data1
data2
data3
data4 | data1, training*
data2, training*
data3, training*
data4, training* |
| For validation | Class1
Class2
Class3
Class4 | data1
data2
data3
data4 | test_data1
test_data2
test_data3
test_data4 | test_data1, test*
test_data2, test*
test_data3, test*
test_data4, test* |
```{note}
For the "training" or "test" Tag, select the one that is prepared in advance on the Tag setup screen.
```
### Add files to the asset
Click [Add files] after confirming that the file group is correctly tagged.
Here, as an example, "training" tag will be set to the asset.
```{image} media/Create_Asset_Tag_training.png
:width: 800px
:name: img_create_asset_tag_training
```
After uploading, verify that data registered in the Asset list and tag are correctly reflected. All available tags will be displayed above asset list. By clicking and selecting any tag there will only show corresponding files. By selecting more than one tag, only the files tagged for both label will be displayed.
```{image} media/Create_Asset_Uploaded.png
:width: 800px
:name: img_create_asset_upload
```
```{tip}
In the Asset list, up to 1000 data are displayed. The total number of currently registered assets can be checked by the number of the denominator.
```
If there is another asset to add, clock [+ Add asset] and repeat the same procedure.
```{image} media/Create_Asset_Add_Another_Asset.png
:width: 800px
:name: img_create_asset_add_another_asset
```
```{important}
When using CSV files, click one of the icons after pressing [Add files] to see if there is header line, and if header string is available for all columns.
This header string is used to confirm that the data of the column are the same in input files. Therefore, the training will fail, if it is not available. By using CSV format checker, the missing header line of all files can be done, or replace header string easily. See [CSV format checker user manual](../csv_format_checker/index_1.html#what-is-csv-format-checker) for detail.
```