This research presents a deep learning approach based on Multi-Layer Perceptron (MLP) for automatically generating eyelash curves in anime character designs. By analyzing the geometric relationship between eye contours and eyelashes, we establish an end-to-end prediction model. Experimental results demonstrate that this method effectively captures eyelash morphological features, achieving an average error of 5.02±2.81 pixels, providing an efficient automated solution for animation production.
In anime character design, eye detail rendering significantly impacts character expressiveness. Eyelashes, as crucial eye features, require careful coordination with eye contours, traditionally demanding substantial time and effort from professional animators. This research aims to leverage deep learning technology to automate eyelash curve generation, enhancing animation production efficiency.
Our research employs curve parameterization to convert eye contours (Curve A) and eyelash curves (Curve B) into unified parameter representations. By establishing local coordinate systems, complex spatial relationships are decomposed into tangential and normal components, providing normalized input features for the deep learning model.
Let
The tangent vector
The parametric equations are defined as:
where
The model adopts a multi-layer perceptron structure with the following forward propagation:
For each layer
where
The final output layer produces the offset predictions:
where
Training configuration:
-
Optimizer: Adam
-
Loss function:
$$L_{MSE} = \frac{1}{N}\sum_{i=1}^N(\hat{y}_i - y_i)^2$$ -
Evaluation metric:
$$MAE = \frac{1}{N}\sum_{i=1}^N|\hat{y}_i - y_i|$$
Through arc length parameterization and local coordinate system transformation, we established a mathematical model for the relative positional relationship between curves. The position of any point on curve B can be expressed in terms of curve A's local coordinate system:
where
To enhance model generalization, training data underwent random movement and scaling augmentation:
Model performance metrics:
Validation Statistics:
Mean Error: 5.0212 ± 2.8087 pixels
Min Error: 1.8515 pixels
Max Error: 11.9900 pixels
Install the required dependencies:
pip install -r requirements.txtTrain the model using the following command:
python train_task.py [options]
Options:
--show Show and save training plots (default: False)The training script will:
- Generate curve variations for training data
- Train the neural network model
- Save the trained model in both Keras (.keras) and ONNX (.onnx) formats
- Save the data scalers for later use
Test the model using the following command:
python test_task.py [options]
Options:
--model_path Path to the model file (TF or ONNX)
--use_onnx Use ONNX model instead of TensorFlow (default: False)
--show_plots Show validation plots (default: False)
--n_validations Number of validation runs (default: 100)Example usage:
# Test with TensorFlow model
python test_task.py --model_path curve_model.keras --show_plots
# Test with ONNX model
python test_task.py --model_path curve_model.onnx --use_onnx --show_plotsLoss function and MAE convergence process:
Model predictions on the test set:
The research outcomes can be applied to:
- Animation production workflow automation
- Character design standardization
- Training assistance for novice animators
- Batch character processing
- NumPy: Numerical computation
- TensorFlow: Deep learning framework
- Matplotlib: Data visualization
- SciPy: Scientific computing
- svg.path: SVG path processing
The main research content is implemented in the research.ipynb notebook, containing complete data processing, model training, and evaluation workflows.
The proposed deep learning method successfully achieves automatic eyelash generation for anime characters, featuring:
- Accurate capture of spatial relationships between eye contours and eyelashes
- Maintenance of character style consistency
- Significant improvement in production efficiency
- Reliable automation tools for animation production
The Kigland team, it's the New Year, let's write a report just for the sake of it. ^ - ^






