Skip to content

OCR Detection

Data Preparation

  • Prepare Training Set Images Collect various types of text images (for character detection, recognition, and text extraction). Each image must have a corresponding text label. It is recommended that these images account for more than 80% of the total dataset.

  • Prepare Test Set Collect various types of text images (for character detection, recognition, and text extraction). Each image must have a corresponding text label. It is recommended that these images account for less than 20% of the total dataset.

TIP

  • If the number of images exceeds 200, please compress them into a zip file and ensure the file size is under 5GB.

Create a Project

Log in to AI Creator and click the "New" button in the project center.

Create Project

Click on "Custom Project", enter the project name "Food Packaging - Character Recognition" in the pop-up window, then click "Next: Import Project Data" to complete the project creation.

Create Project

Import Data

  • Click on "Dataset" in the left-hand navigation bar.
  • Upload the training and test image sets
    • When the project is created, folders for both the dataset and training data are automatically generated. Navigate to either the training or test set folder, click "Import Images" -> "New Dataset", and drag and drop images or compressed files into the upload area. Then click "OK" to import the data.

Import Data

Add Algorithm Module

  • Click "Label & Train" in the left-hand navigation bar.
  • Click "Add Module" and select "OCR" in the module selection window.

Add Algorithm Module

Click the "Link Data" drop-down menu and select "Link Images". In the pop-up window, choose the training set, then click "OK" to confirm.

Link Images

Data Labeling

  1. Click "Label & Train" in the left-hand navigation bar.

  2. Label Data Use the labeling tool (rectangle or polygon tool) to highlight the characters that need recognition. In the pop-up labeling box, enter the actual text in the image, confirm the label (by clicking the checkmark icon), and save the label information for the entire image (shortcut: Ctrl+Shift+S).

Data Labeling

TIP

  • If there are multiple characters to label, repeat the labeling process for all character regions before saving the label information.

Model Training

  1. Click the "Train Model" button in the top-right corner of the page to enter the model training settings.

  2. Set general parameters: Use default values for brightness, batch size, and learning rate. Set the number of training epochs according to your needs (e.g., 300 epochs).

  3. In "Dataset Split", set the training set ratio to 80%.

  4. For fresh training, select "Train from Scratch". To continue training from the previous model, choose "Add Sample Training".

  5. Set the threshold to the default value of 15.

  6. After setting the parameters, click "Start Training".

Model Training

TIP

For detailed explanations of specific parameters, hover over the help icon next to each parameter.

Training Process

Once training begins, the page will automatically display the training details. You can view real-time logs, such as the current epoch, and monitor metrics like global_step and learning rate (lr).

Training Process

Training Completion

AI Creator will automatically evaluate and save multiple trained models. After training is complete, the system will select the best-performing model and archive it as a version. The model will then undergo an initial evaluation based on this version.

Training Complete

Model Evaluation

After training, the system will automatically select the best model for evaluation and calculate performance metrics.

Model Evaluation

AI Creator allows evaluation of the training images and displays results, such as annotations, outputs, and ROIs.

If the evaluation does not meet expectations, iterate through the following steps until satisfactory results are achieved:

  • Continue training with additional samples: Select "Add Sample Training" and retrain.
  • Add new images, annotate them, and select "Add Sample Training" to retrain.

Model Validation

Once the evaluation meets expectations, independently validate the model using test set images.

  1. Click "Project Validation" in the left-hand navigation bar.

  2. In the model validation page, select the test set images and click "Start Validation". Model Validation

  3. View the validation results. After validation, the system will automatically navigate to the validation results page.

Model Validation

Model Optimization

  1. Click "Model Optimization" in the left-hand navigation bar.
  2. To run models trained on x86 platforms on ARM-based edge devices, model conversion and optimization are required. AI Creator supports both auto optimization and advanced optimization.

Model Optimization

Deployment

Click "Deployment" in the left-hand navigation bar to access the deployment page.

Generate Smart Camera Application

In the deployment interface, click the "Generate Smart Camera Application" button. In the pop-up window, enter the application ID, version number, name, and description. Select the model version to deploy and choose the data (static images used by the smart camera for inference), then click "OK" to generate the application.

Generate Smart Camera Application

Deploy Application

In the deployment interface, click the "Deploy" tab to access the application deployment interface.

Node Integration

Before deploying the model or application, integrate the device node to be deployed.

  • Click "Node Management" at the top of the page to enter the node management interface.
  • Click "Integrate Node" to open the integration window.
  • In the integration window, select "IP Integration". Under node type, choose "Smart Camera", enter the node name and IP address, and click "OK".

Node Integration

Once the device is integrated, the "Node Type & Connection Status" will display as "Smart Camera: Online".

Return to the Project Deployment Page

Click "Project Center" and in the operation list of the current project, click "Deploy" to enter the main deployment page.

Deploy Smart Camera Application

On the deployment page, click the "Deploy" tab. In the operation list of the smart camera node you created, click "Deploy Application" -> "Deploy".

Deploy Smart Camera Application

Application Deployment Verification

After AI Creator completes the deployment, run the deployed application on the smart camera node and check the results.

TIP

This part is not an AI Creator feature, but a direction for next steps.