| Optuna | |
|---|---|
| Developer | Preferred Networks |
| Release | Version 1.0 (January, 2020) |
| Stable release | Version 4.4.0 (June 16, 2025)
|
| Written in | Python |
| Available in | English |
| License | MIT License |
| Website | optuna |
| Repository | github |
Optuna is an open-source Python library for automatic hyperparameter tuning of machine learning models. It was first introduced in 2018 by Preferred Networks, a Japanese startup that works on practical applications of deep learning in various fields. The beta version of Optuna was released at the end of the year, with the subsequent first major stable release announced in January 2020.

Hyperparameter optimization involves finding the optimal value of non-trainable parameters, defined by the user. Examples of hyperparameters are learning rate, number of layers or neurons, regularization strength, and tree depth. However, the optimal values strongly depend on the specific algorithm (e.g., classification, regression, or clustering).
Hyperparameter optimization can be especially relevant when dealing with large-scale problems or limited resources, as it improves model accuracy, reduces overfitting, and decreases training time. However, when the hyperparameter space increases, it may become computationally expensive. Hence, there are methods (e.g., grid search, random search, or Bayesian optimization) that considerably simplify this process.
Optuna is designed to optimize model hyperparameters by searching large spaces and discarding combinations that show no significant improvement in the model. Moreover, it can parallelize the hyperparameter search over multiple threads or processes. Optuna works with a high degree of modularity, allowing the definition of different configurations for searching hyperparameters. It is possible to choose which hyperparameters to optimize and how to optimize them. Additionally, it permits parameter customization at runtime, meaning that the values to explore for the hyperparameters (i.e., the search space) can be defined while writing the code, rather than being defined in advance.

Optuna exploits well-established algorithms to perform hyperparameter optimization, progressively reducing the search space in light of objective values. Examples include Gaussian-process-based algorithms (i.e., a Gaussian process to model the objective function), tree-structured Parzen estimator (TPE) (i.e., a model-based optimization method that estimates the objective function and selects the best hyperparameters), and random search (i.e., a basic optimization approach used for benchmarking).

Optuna includes a pruning feature to stop trials early when the results show no significant improvement in the model. This prevents unnecessary computation and is used for models with long training times to save time and computational resources. Specifically, Optuna exploits techniques such as median and threshold pruning.
Optuna is designed to scale with distributed computing resources, supporting parallel execution. This feature allows users to run optimization trials across multiple processors or machines.
Optuna integrates with various machine-learning (ML) libraries and frameworks:
Moreover, Optuna offers a real-time dashboard that allows a user to monitor the optimization history and the hyperparameter importance through graphs and tables.
Optuna was designed to be framework-agnostic so that it can be used with any machine-learning (ML) or deep-learning (DL) framework.

This section contains an excessive amount of intricate detail. (July 2025) |
Optuna can be used to optimize the hyperparameters of ML models. Examples include:
In the context of deep learning, Optuna can be used during the training of neural networks (NN) to optimize the learning rate, batch size, and number of hidden layers. For example, it can be used for:
Optuna has found applications in various research studies and industry implementations across different domains.
In healthcare, Optuna is currently used for medical image analysis to optimize DL models for tumor detection, disease identification, multi-organ semantic segmentation, and radiological image analysis. It can also be used for disease prediction, in particular to improve the accuracy of predictive models for disease diagnosis and treatment outcomes. It can also be used in genomics to predict genetic diseases and identify genetic variations.
In finance, Optuna is used to optimize models for algorithmic trading. It can be used to predict market movements because of its ability to handle wide parameter ranges and complex model structures. In particular, it is used for financial risk analysis and forecasting. The risks addressed are credit, market, and operational risks.
Optuna is used for real-time applications in autonomous systems for robotics, supporting decision-making in dynamic environments. It is also used in the context of self-driving cars to optimize models for navigating safely in complex environments. For example, Optuna can be used in scenarios where there is a need to evaluate the rate and severity of accidents or address network intrusion attacks due to potential vulnerabilities.
Optuna has also been applied in NLP. For example, it has been used for text classification to classify written text (e.g., spam vs. not spam, topic modeling). Another task is sentiment analysis, namely the detection of feelings expressed in text, which is particularly used to analyze content from social media and customer reviews.
Regarding RL, Optuna is used in gaming to improve model performance in games and virtual environments. In robotics, it has been used to optimize decision-making processes in robotic systems for tasks such as manipulation and navigation. Additionally, in the field of autonomous vehicles, Optuna can optimize RL models to improve safety and navigation efficiency.
{{cite journal}}: CS1 maint: periodical has ISBN (link)