Image Restoration via the Integration of Optimal Control Techniques and the Hamilton–Jacobi–Bellman Equation
Abstract
1. Introduction
- A new optimal-control-based formulation for image restoration, with a cost design balancing smoothness and fidelity, grounded in rigorous theory.
- The derivation, analysis, and implementation of the associated HJB equation.
- An efficient numerical solution scheme, supported by a documented Python implementation (Python 3.13.5, Appendix A).
- A comprehensive experimental validation across diverse noise regimes and a comparison with state-of-the-art restoration approaches.
2. Mathematical Formulation of the Problem
- denotes the Euclidean norm in () and is a constant (non-zero) diffusion coefficient.
- is the control vector, representing local modifications to the restoration dynamics (e.g., local adjustment of diffusion intensity).
- is the state vector associated with , representing pixel intensities or other image descriptors.
- is a continuous, non-negative state-dependent cost penalizing deviations from desired image properties. Typical choices include , but more sophisticated models reflecting edge preservation can be used.
- is a stopping time defined by for a fixed . This ensures the process evolves within the bounded domain .
- The symbol denotes the expectation operator with respect to the probability law P of the stochastic process , i.e., the average over all realizations of the process noise. The notation P denotes the probability measure induced by the stochastic dynamics on the space of the trajectories, so that, for an event A in the trajectory space, is the probability that the process path lies in A.
Remarks on Well-Posedness
3. Radial Reduction and Main Result
Boundary Conditions
- Step 1. Removal of the singularity at . Multiplying (12) by yieldsIntegrating from 0 to r and using gives
- Step 3. Global continuation. The continuity of h on ensures the boundedness of the RHS of (12) on compact subintervals of , allowing for the extension of the local solution to .
- Step 4. Reconstruction of . Given v, defineThen is strictly decreasing and on ; choose to satisfy .
- Step 5. Uniqueness. Assume that there exist two classical solutions and of the boundary value problem satisfyingDefine their difference by . A standard uniqueness argument for such problems yields that for all . Consequently, for all , proving the uniqueness of the solution.
4. Optimality and Verification
Structural Properties: Monotonicity and Uniqueness
- Radial symmetry: depends only on , ensuring invariance under rotations. This aligns with isotropic degradation models relevant to image noise.
- Monotonicity: The radial profile is strictly decreasing for , i.e., . Consequently, the magnitude of the optimal control is monotone in r, meaning that stronger restoration is applied to regions corresponding to greater degradation.
- Uniqueness: Well-posedness of the HJB boundary value problem under the given structural conditions implies a unique V, and hence a unique optimal feedback control law. This guarantees consistent algorithmic behaviour across executions and image regions.
5. Numerical Simulation and Procedure
5.1. Model Parameters and Notation
- N: Dimension of the state space. For RGB colour images, .
- : Diffusion coefficient controlling the stochastic perturbation amplitude (smoothing intensity).
- : Threshold for the Euclidean norm; the simulation stops when . This models the exit time from the admissible domain and corresponds to the maximum allowable degradation.
- : Terminal boundary value for V on .
- : Exponent in the intervention cost , governing the nonlinearity of the control penalty.
5.2. Image Cost Function
5.3. Reduction to a Radial ODE
5.4. Optimal Feedback and Simulation of the Dynamics
5.5. Python Implementation and Reproducibility
- 1.
- The numerical solution of the radial ODE via a shooting method with adaptive step control.
- 2.
- The simulation of the stochastic dynamics with the computed .
Numerical Experiments
- Case 1: Quadratic cost, .
- Case 2: Quadratic cost, .
5.6. Interpretation of the Parameter
- Degree of nonlinearity: For , the cost function scales almost linearly with , so that moderate control interventions incur nearly proportional costs. This tolerance enables vigorous corrections in regions with strong noise. In contrast, as , the cost becomes almost quadratic, so small increases in control effort lead to disproportionately large penalties. Numerically, this yields a more conservative restoration process, reducing the risk of over-smoothing and helping to preserve fine image structures.
- Impact on the feedback control: The optimal feedback control law from the HJB formulation contains the factor , which directly modulates the sensitivity of the control amplitude to . In the radial setting, measures the local rate of change of the value function, interpretable as the net local restoration rate. Larger (in magnitude) negative values of indicate more severe degradation, leading to stronger corrective action “that is, more intensive filtering” in those regions.
- Sensitivity in image restoration: For smaller , the model tolerates strong controls at almost linear cost growth, enabling aggressive noise suppression when necessary. For larger , the penalty rises steeply, leading to finer, more cautious adjustments. This is important in applications where preserving edge sharpness and small-scale features is as critical as removing noise: the control penalization prevents overcorrection that would remove meaningful content.
5.7. Interpretation and Applications in Image Restoration
- Value function as a quality indicator: The value function can be interpreted as a quantitative measure of image quality. Lower values of correspond to regions of higher degradation (greater r), signalling the need for more intensive restoration.
- Optimal feedback control as an adaptive filter: The optimal control derived from the HJB framework,
- Balanced restoration response: This adaptive behaviour is critical in practice. Excessive filtering in low-noise regions can blur fine textures and edges, while insufficient filtering in heavily degraded regions leaves residual noise. The feedback control from the HJB model automatically balances these extremes, modulating the intensity of restoration in a spatially dependent fashion.
6. A Concrete Example of the Application of the Theory in Image Restoration
6.1. The Image Restoration Model as an Optimal Control Problem
- is the degraded image (e.g., corrupted by additive Gaussian noise);
- is the local control applied to adjust pixel intensities (acting as a denoising filter);
- is the noise intensity, with a small value chosen to regularize the HJB and to model weak, spatially varying perturbations;
- is a family of independent Wiener processes indexed by pixel location x, representing discrete space–time white noise.
6.2. Numerical Implementation
- 1.
- Solve the HJB Equation: Use the shooting method implementation in Appendix A to compute an approximation of V.
- 2.
- Compute the Optimal Control: For , , with computed numerically.
- 3.
- Iterative Image Update: Apply the control in a controlled diffusion process to progressively denoise the image while retaining key features.
6.3. Python Code for Practical Example
Numerical Experiments
- Case :
- Case :
- The high performance of for detail preservation;
- The importance of tuning to balance denoising and fidelity;
- The flexibility of the HJB-based control framework to adapt to noise levels and cost function choices.
6.4. Explanation of the Python Code
- 1.
- Model Setup: The code first defines the essential model parameters: the state dimension N, diffusion coefficient , exit threshold R, initial condition , and the exponent . The state-dependent cost is chosen as
- 2.
- Solving the Radial ODE: Under radial symmetry, the HJB equation reduces to an ODE for . This is solved numerically using SciPy’s solve_ivp in combination with a shooting method to satisfy . The solver returns and , both of which are needed to construct the optimal feedback .
- 3.
- Simulation of Image Dynamics: The pixel intensity vector y evolves according toA lower bound on r is enforced to avoid division singularities. The value is interpolated from the ODE solution, and the system is integrated using the Euler–Maruyama method.
- 4.
- Integration with the TV Chambolle Algorithm: The restored image is normalized to and passed through the total variation Chambolle algorithm to further suppress residual noise. While effective, this step can introduce mild over-smoothing.
- 5.
- Image Reconversion: After post-processing, the image is rescaled to and cast to uint8 format for display and metric computation.
- 6.
- Evaluation and Parameter Tuning: The implementation includes routines to compute MSE, PSNR, and SSIM. Parameter sweeps over , total simulation time T, and time step identify configurations that maximize PSNR.
- 7.
- 3D Visualization of Difference Maps: Besides plotting , drift, and surfaces, the code also generates 3D surfaces of absolute differences between the original and restored/denoised images. Both images are converted to greyscale (via a luminance transform) before pixel-wise differences are computed and visualized.
6.5. Experimental Results
- Rapid convergence: The numerical scheme for solving the HJB equation converges quickly to the value function V, even for finely discretized grids and small time steps, demonstrating computational efficiency.
- Enhanced image quality: Quantitative metrics (PSNR, SSIM, and MSE) show significant improvements over classical denoising techniques such as Gaussian smoothing and standard total variation minimization, confirming the benefit of the control-theoretic formulation.
- 1.
- The theoretical elegance and provable optimality of HJB-based control laws;
- 2.
- The practical efficacy required in modern imaging pipelines.
7. Conclusions and Future Directions
- Extended Cost Functions: Exploring alternative formulations for the cost function could allow better adaptation to various types of image noise and degradation.
- Adaptive Multi-scale Approaches: Incorporating multi-scale strategies and developing adaptive parameter tuning methods could enhance performance, particularly for high-resolution and complex images.
- Hybrid Deep Learning Models: Integrating the rigorous control framework with data-driven deep learning approaches may combine the benefits of theoretical guarantees and empirical performance, leading to robust hybrid models.
- Real-time Implementation: Improving computational efficiency would pave the way for real-time image restoration applications, which are critical in fields such as medical imaging and video processing.
- Spatial Adaptivity of Control: An interesting avenue for future work is to relax the current assumption that each pixel follows the same one-dimensional control process, by introducing spatial heterogeneity into the model; for example, the parameters or the penalty function could be adapted locally based on image statistics or estimated noise levels, thereby tailoring the restoration dynamics to the varying characteristics of different regions within the image.
- Extension to Regime-Switching Systems of Equations: Inspired by the recent work of [19], a promising direction is to adapt coupled Hamilton–Jacobi–Bellman systems arising from regime-dependent dynamics to the image restoration context. In this setting, different “regimes” could represent varying noise environments (e.g., changes in noise variance, blur intensity, or illumination), modelled via a finite-state Markov chain. The resulting system of PDEs, one per regime and coupled through switching terms, would enable the design of regime-adaptive feedback controls capable of rapidly adjusting restoration strategies in response to changing imaging conditions. Numerical schemes such as monotone iteration, proven effective in the production planning setting, could be employed to solve these coupled equations and analyse sensitivity with respect to regime-switching parameters.
Funding
Data Availability Statement
Acknowledgments
Conflicts of Interest
Appendix A
- Listing A1.
- Python code for the radial ODE.
import numpy as np import matplotlib.pyplot as plt from scipy.integrate import solve_ivp # #################################### # Model Parameters # #################################### N = 3 # Dimension of the state space. sigma = 0.189 # Diffusion coefficient (image noise). R = 10.0 # Threshold for the state norm. u0 = 97.799 # Initial condition: u(r0) = u0. alpha = 2 # Exponent in the intervention cost function. # #################################### # Shooting and PDE Parameters # #################################### r0 = 0.01 # Small starting r to avoid singularity at 0. r_shoot_end = R # We integrate up to r = R. rInc = 0.1 # Integration step size. # #################################### # Image Dynamics Simulation Parameters # #################################### dt = 0.01 # Time step for Euler-Maruyama simulation. T = 10 # Maximum simulation time. # #################################### # Image Cost Function # #################################### def h(r): """ Image cost function: h(r) = r^2. This penalizes larger deviations (i.e., larger image state norms). """ return r**2 # #################################### # Helper Function for Safe Power Computation # #################################### def safe_power(u_prime, exponent, lower_bound=1e-8, upper_bound=1e2): """ Compute (-u_prime)^exponent safely by clipping -u_prime between lower_bound and upper_bound. We assume u_prime is negative. """ safe_val = np.clip(-u_prime, lower_bound, upper_bound) return np.power(safe_val, exponent) # #################################### # ODE Definition for the Value Function # #################################### def value_function_ode(r, u): """ Defines the ODE for u(r) based on the reduced HJB equation: u’’(r) = -((N-1)/r)*u’(r) + (2/sigma^2)*[ A*(-u’(r))^(alpha/(alpha-1)) - h(r) ], where A = (1/alpha)^(1/(alpha-1)) * ((alpha-1)/alpha). Debug prints are added to alert us to potential instabilities. """ # Ensure r is not too small (avoid singularity) if abs(r) < 1e-6: r = 1e-6 u_val = u[0] u_prime = u[1] # Ensure u_prime is negative. If not, force to a small negative number. if u_prime >= 0: print(f"[DEBUG]⊔At⊔r⊔=⊔{r:.4f},⊔u_prime ({u_prime})⊔is⊔nonnegative.⊔Forcing⊔to⊔-1e-8.") u_prime = -1e-8 A = (1 / alpha) ** (1/(alpha-1)) * ((alpha-1) / alpha) exponent = alpha / (alpha - 1) term = A * safe_power(u_prime, exponent) du1 = u_prime du2 = -((N-1) / r) * u_prime + (2/(sigma**2)) * (term - h(r)) # Extra debug output in a region where instability was observed. if 0.45 < r < 0.5: print(f"[DEBUG]⊔r⊔=⊔{r:.4f}:⊔u⊔=⊔{u_val},⊔u_prime⊔(used)⊔=⊔{u_prime}") return [du1, du2] # #################################### # Solve the Radial ODE via a Shooting Method # #################################### print("Starting⊔ODE⊔integration\ldots") r_values = np.arange(r0, r_shoot_end + rInc*0.1, rInc) initial_derivative = -1e-6 # A small negative initial derivative. u_initial = [u0, initial_derivative] # Using a stiff solver (BDF) with tight tolerances for stability. sol = solve_ivp( value_function_ode, [r0, r_shoot_end], u_initial, t_eval=r_values, method=’BDF’, # Stiff solver. rtol=1e-10, atol=1e-10 ) if sol.success: print("ODE integration successful!") print(f"Number⊔of⊔r-points:⊔{len(sol.t)}") else: print("ODE⊔integration⊔failed!") # #################################### # Compute the Boundary Condition g # #################################### # We have: u(r) = u(r0) - ?[r0 to r] (-u’(s)) ds. v_values = -sol.y[1] # Since u’(r) is negative, -u’(r) is positive. integral_v = np.trapz(v_values, sol.t) g_boundary = u0 - integral_v g_from_solution = sol.y[0][-1] print("Computed⊔boundary⊔condition⊔g⊔(from integral):", g_boundary) print("Computed⊔boundary⊔condition⊔g⊔(from⊔ODE⊔solution):", g_from_solution) # #################################### # Plot Value Function and Its Derivative # #################################### plt.figure(figsize=(10, 5)) plt.plot(sol.t, sol.y[0], label="Value⊔Function⊔u(r)") plt.plot(sol.t, sol.y[1], label="Derivative⊔u’(r)") plt.axhline(y=g_from_solution, color=’r’, linestyle=’--’, label=f"Boundary:⊔u(R)⊔=⊔{g_from_solution:.4f}") plt.xlabel("r⊔(Image State Norm)") plt.ylabel("u(r)⊔⊔u’(r)") plt.title("Shooting⊔Method:⊔u(r)⊔and⊔u’(r)") plt.legend() plt.show() print("Displayed⊔Value⊔Function⊔plot.") # #################################### # Image Dynamics Simulation # #################################### def simulate_image_dynamics(x_init, dt, T): """ Simulates the dynamics of image states using the Euler-Maruyama method. The SDE for each component is given by: dx_i = [ ((1/alpha)^(1/(alpha-1))*(1/r)*(-u’(r))^(1/(alpha-1)))*x_i ] dt + sigma*dW_i, where r = ||x||, and u’(r) is obtained via interpolation from the ODE solution. The simulation stops if ||x|| >= R. """ timesteps = int(T / dt) x = np.zeros((N, timesteps)) x[:, 0] = x_init for t in range(1, timesteps): r_norm = np.linalg.norm(x[:, t-1]) r_norm_safe = r_norm if r_norm > 1e-6 else 1e-6 # Interpolate to get u’(r) from the ODE solution. u_prime_val = np.interp(r_norm, sol.t, sol.y[1]) if u_prime_val >= 0: print(f"[DEBUG]⊔At⊔simulation⊔step⊔{t},⊔u_prime_val⊔({u_prime_val})⊔was⊔nonnegative.⊔Forcing⊔to⊔-1e-8.") u_prime_val = -1e-8 restoration_rate_unit = ((1/alpha)**(1/(alpha-1))) * (1.0 / r_norm_safe) * \ safe_power(u_prime_val, 1/(alpha-1)) for i in range(N): drift = restoration_rate_unit * x[i, t-1] x[i, t] = x[i, t-1] + drift * dt + sigma * np.random.normal(0, np.sqrt(dt)) if np.linalg.norm(x[:, t]) >= R: x = x[:, :t+1] print(f"[DEBUG]⊔Stopping⊔simulation⊔at⊔step⊔{t}⊔as⊔state⊔norm⊔reached/exceeded⊔R.") break return x print("Starting image dynamics simulation\ldots") x_initial = np.array([1.0] * N) image_trajectories = simulate_image_dynamics(x_initial, dt, T) print("Image⊔dynamics⊔simulation⊔complete.") # #################################### # Plot Image State Trajectories # #################################### plt.figure(figsize=(10, 5)) time_axis = np.arange(image_trajectories.shape[1]) * dt for i in range(N): plt.plot(time_axis, image_trajectories[i], label=f"Component⊔{i+1}") plt.xlabel("Time") plt.ylabel("Image⊔State⊔Deviation") plt.title("Image⊔Dynamics⊔Trajectories⊔(Euler-Maruyama Simulation)") plt.legend() plt.show() print("Displayed⊔Image⊔Dynamics⊔plot.") # #################################### # Plot Net Restoration Rate (Per Unit Deviation) # #################################### # Ensure that u’(r) is safe for all r. u_prime_safe_array = np.where(sol.y[1] >= 0, -1e-8, np.clip(sol.y[1], -100, -1e-8)) net_rest_rate_per_unit = ((1/alpha)**(1/(alpha-1))) * (1/sol.t) * \ np.power(-u_prime_safe_array, 1/(alpha-1)) plt.figure(figsize=(10, 5)) plt.plot(sol.t, net_rest_rate_per_unit, label="Net⊔Restoration⊔Rate⊔per⊔Unit⊔Deviation") plt.xlabel("r⊔(Image⊔State⊔Norm)") plt.ylabel("Rate") plt.title("Net⊔Restoration⊔Rate⊔per⊔Unit⊔Deviation⊔vs.⊔r") plt.legend() plt.show() print("Displayed⊔restoration⊔rate⊔(per⊔unit⊔deviation)⊔plot.") # =================== Plot Magnitude of the Net Restoration Rate ======================= net_rest_rate_magnitude = ((1/alpha)**(1/(alpha-1))) * \ np.power(-u_prime_safe_array, 1/(alpha-1)) plt.figure(figsize=(10, 5)) plt.plot(sol.t, net_rest_rate_magnitude, label="Magnitude⊔of⊔Net⊔Restoration⊔Rate") plt.xlabel("r⊔(Image⊔State⊔Norm)") plt.ylabel("Magnitude") plt.title("Magnitude⊔of⊔the⊔Net⊔Restoration⊔Rate⊔vs.⊔r") plt.legend() plt.show() print("Displayed⊔net⊔restoration⊔rate⊔magnitude⊔plot.") print("All⊔computations⊔and⊔plots⊔have⊔been⊔executed.") |
Appendix B
- Listing A2.
- Python code for image restoration.
import numpy as np import matplotlib.pyplot as plt from scipy.integrate import solve_ivp from PIL import Image from skimage.metrics import peak_signal_noise_ratio, structural_similarity from skimage.restoration import denoise_tv_chambolle import itertools from mpl_toolkits.mplot3d import Axes3D # noqa: F401 (needed for 3D plots) # ----------------------------- # Model parameters # ----------------------------- N = 3 sigma = 0.05 R = 100.0 u0 = 297.79 alpha = 2 r0 = 0.01 r_shoot_end = R rInc = 0.1 # ----------------------------- # Cost function # ----------------------------- def h(r): return np.log(r + 1) # ----------------------------- # Safe power helper # ----------------------------- def safe_power(u_prime, exponent, lower_bound=1e-8, upper_bound=1e2): safe_val = np.clip(-u_prime, lower_bound, upper_bound) return np.power(safe_val, exponent) # ----------------------------- # Radial ODE # ----------------------------- def value_function_ode(r, u): if abs(r) < 1e-6: r = 1e-6 u_prime = u[1] if u_prime >= 0: u_prime = -1e-8 A = (1/alpha) ** (1/(alpha - 1)) * ((alpha - 1) / alpha) exponent = alpha / (alpha - 1) term = A * safe_power(u_prime, exponent) du1 = u_prime du2 = - ((N - 1) / r) * u_prime + (2 / (sigma ** 2)) * (term - h(r)) return [du1, du2] # ----------------------------- # Solve ODE # ----------------------------- print("Starting⊔ODE⊔integration\ldots") r_values = np.arange(r0, r_shoot_end + rInc*0.1, rInc) u_initial = [u0, -1e-6] sol = solve_ivp(value_function_ode, [r0, r_shoot_end], u_initial, t_eval=r_values, method=’BDF’, rtol=1e-10, atol=1e-10) if sol.success: print("ODE⊔integration⊔successful!") else: raise RuntimeError("ODE⊔integration⊔failed") # Boundary condition check (np.trapezoid instead of np.trapz) v_values = -sol.y[1] integral_v = np.trapezoid(v_values, sol.t) g_boundary = u0 - integral_v g_from_solution = sol.y[0][-1] print("Computed⊔boundary⊔condition⊔g⊔(from⊔integral):", g_boundary) print("Computed⊔boundary⊔condition⊔g⊔(from⊔ODE⊔solution):", g_from_solution) # ----------------------------- # Restore image (spatially varying noise) # ----------------------------- def restore_image(image_initial, dt, T, sol, alpha, sigma): timesteps = int(T / dt) x = image_initial.copy() for _ in range(timesteps): r = np.linalg.norm(x, axis=-1) r_safe = np.where(r > 1e-6, r, 1e-6) u_prime_val = np.interp(r_safe, sol.t, sol.y[1]) u_prime_val = np.where(u_prime_val >= 0, -1e-8, u_prime_val) restoration_rate_unit = ((1/alpha) ** (1/(alpha - 1))) * \ (1.0 / r_safe) * \ safe_power(u_prime_val, 1/(alpha - 1)) drift = restoration_rate_unit[..., np.newaxis] * x # i.i.d. Gaussian noise per pixel and channel (spatial variation) noise = sigma * np.random.normal(0, np.sqrt(dt), x.shape) x = x + drift * dt + noise x = np.clip(x, -R, R) return x # ----------------------------- # Load and normalize image # ----------------------------- img = Image.open("lenna.png").convert("RGB") img_array = np.array(img).astype(np.float64) img_mean = np.mean(img_array, axis=(0, 1), keepdims=True) img_centered = img_array - img_mean max_abs = np.max(np.abs(img_centered)) scale_factor = (R/2) / max_abs if max_abs != 0 else 1 x_initial = img_centered * scale_factor # ----------------------------- # Parameter tuning # ----------------------------- sigma_values = [0.002, 0.007, 0.0189, 0.05] T_values = [0.197, 1.0] dt_values = [0.01, 0.17] results = [] print("\nParameter⊔Tuning⊔Results:") for sigma_param, T_param, dt_param in itertools.product(sigma_values, T_values, dt_values): restored_state = restore_image(x_initial, dt_param, T_param, sol, alpha, sigma_param) restored_image = restored_state / scale_factor + img_mean restored_image = np.clip(restored_image, 0, 255) mse_val = np.mean((img_array - restored_image) ** 2) psnr_val = peak_signal_noise_ratio(img_array.astype(np.uint8), restored_image.astype(np.uint8), data_range=255) ssim_val = structural_similarity(img_array.astype(np.uint8), restored_image.astype(np.uint8), channel_axis=-1, data_range=255) results.append({’sigma’: sigma_param, ’T’: T_param, ’dt’: dt_param, ’MSE’: mse_val, ’PSNR’: psnr_val, ’SSIM’: ssim_val}) print(f"MSE:⊔{mse_val:.4f},⊔PSNR:⊔{psnr_val:.4f}⊔dB,⊔SSIM:⊔{ssim_val:.4f}") best_config = max(results, key=lambda r: r[’PSNR’]) print("\nBest⊔configuration⊔based⊔on⊔PSNR:") print(best_config) # ----------------------------- # Final restoration and TV denoising # ----------------------------- restored_state_best = restore_image(x_initial, best_config[’dt’], best_config[’T’], sol, alpha, best_config[’sigma’]) restored_image_best = restored_state_best / scale_factor + img_mean restored_image_best = np.clip(restored_image_best, 0, 255).astype(np.uint8) restored_image_norm = restored_image_best.astype(np.float64) / 255.0 tv_weight = 0.089 restored_image_denoised_norm = denoise_tv_chambolle(restored_image_norm, weight=tv_weight, channel_axis=-1) restored_image_denoised = np.clip(restored_image_denoised_norm * 255, 0, 255).astype(np.uint8) # ----------------------------- # Display 2D images # ----------------------------- plt.figure(figsize=(18, 6)) plt.subplot(1, 3, 1) plt.imshow(img_array.astype(np.uint8)) plt.title("(i)⊔Original⊔Degraded⊔Image") plt.axis("off") plt.subplot(1, 3, 2) plt.imshow(restored_image_best) plt.title("(ii)⊔Restored⊔Image") plt.axis("off") plt.subplot(1, 3, 3) plt.imshow(restored_image_denoised) plt.title("(iii)⊔Restored⊔and⊔Denoised⊔Image") plt.axis("off") plt.tight_layout() plt.show() # ----------------------------- 3D difference surfaces (as in the paper) # ----------------------------- def rgb2gray(img): return np.dot(img[..., :3], [0.2989, 0.5870, 0.1140]) original_gray = rgb2gray(img_array.astype(np.float64)) restored_gray = rgb2gray(restored_image_best.astype(np.float64)) denoised_gray = rgb2gray(restored_image_denoised.astype(np.float64)) diff_restored_denoised = np.abs(restored_gray - denoised_gray) diff_original_restored = np.abs(original_gray - restored_gray) diff_original_denoised = np.abs(original_gray - denoised_gray) rows, cols = diff_restored_denoised.shape X, Y = np.meshgrid(np.arange(cols), np.arange(rows)) fig3 = plt.figure(figsize=(24, 8)) ax1 = fig3.add_subplot(1, 3, 1, projection=’3d’) surf1 = ax1.plot_surface(X, Y, diff_restored_denoised, cmap=’plasma’, alpha=0.85, linewidth=0) ax1.set_title("3D⊔Surface:⊔Diff⊔(i)⊔Restored⊔vs⊔Denoised") ax1.set_xlabel("Pixel⊔Column") ax1.set_ylabel("Pixel⊔Row") ax1.set_zlabel("Difference⊔Intensity") fig3.colorbar(surf1, ax=ax1, shrink=0.6, aspect=12) ax2 = fig3.add_subplot(1, 3, 2, projection=’3d’) surf2 = ax2.plot_surface(X, Y, diff_original_restored, cmap=’coolwarm’, alpha=0.85, linewidth=0) ax2.set_title("3D⊔Surface:⊔Diff⊔(ii)⊔Original⊔vs⊔Restored") ax2.set_xlabel("Pixel⊔Column") ax2.set_ylabel("Pixel⊔Row") ax2.set_zlabel("Difference⊔Intensity") fig3.colorbar(surf2, ax=ax2, shrink=0.6, aspect=12) ax3 = fig3.add_subplot(1, 3, 3, projection=’3d’) surf3 = ax3.plot_surface(X, Y, diff_original_denoised, cmap=’inferno’, alpha=0.85, linewidth=0) ax3.set_title("3D⊔Surface:⊔Diff⊔(iii)⊔Original⊔vs⊔Restored⊔&⊔Denoised") ax3.set_xlabel("Pixel⊔Column") ax3.set_ylabel("Pixel⊔Row") ax3.set_zlabel("Difference⊔Intensity") fig3.colorbar(surf3, ax=ax3, shrink=0.6, aspect=12) plt.tight_layout() plt.show() |
References
- Rudin, L.I.; Osher, S.; Fatemi, E. Nonlinear total variation based noise removal algorithms. Phys. D 1992, 60, 259–268. [Google Scholar] [CrossRef]
- Buades, A.; Coll, B.; Morel, J.-M. A non-local algorithm for image denoising. In Proceedings of the 2005 IEEE Computer Society Conference on Computer Vision and Pattern Recognition (CVPR’05), San Diego, CA, USA, 20–25 June 2005; Volume 2, pp. 60–65. [Google Scholar]
- Chan, T.F.; Shen, J. Image Processing and Analysis: Variational, PDE, Wavelet, and Stochastic Methods; Society for Industrial and Applied Mathematics: Philadelphia, PA, USA, 2005; 421p, Available online: https://books.google.ro/books?id=3OMHzOpJ0v0C (accessed on 29 August 2025).
- Dabov, K.; Foi, A.; Katkovnik, V.; Egiazarian, K. Image denoising by sparse 3-D transform-domain collaborative filtering. IEEE Trans. Image Process. 2007, 16, 2080–2095. [Google Scholar] [CrossRef] [PubMed]
- Weickert, J. Anisotropic Diffusion in Image Processing; Teubner: Stuttgart, Germany, 1998. [Google Scholar]
- Chambolle, A. An algorithm for total variation minimization and applications. J. Math. Imaging Vis. 2004, 20, 89–97. [Google Scholar] [CrossRef]
- Zhang, K.; Zuo, W.; Chen, Y.; Meng, D.; Zhang, L. Beyond a Gaussian denoiser: Residual learning of deep CNN for image denoising. IEEE Trans. Image Process. 2017, 26, 3142–3155. [Google Scholar] [CrossRef] [PubMed]
- Alvarez, O. A quasilinear elliptic equation in ℝn. Proc. Roy. Soc. Edinb. Sect. A 1996, 126, 911–921. [Google Scholar] [CrossRef]
- Canepa, E.C.; Covei, D.-P.; Pirvu, T.A. A stochastic production planning problem. Fixed Point Theory 2022, 23, 179–198. [Google Scholar] [CrossRef]
- Pham, H. Continuous-Time Stochastic Control and Optimization with Financial Applications; Springer: Berlin/Heidelberg, Germany, 2009. [Google Scholar]
- Zhang, X. Nonlocal regularization methods for image restoration: A review. Lect. Notes 2009. Available online: https://www.math.ucla.edu/~lvese/285j.1.09f/NonlocalMethods_main.slides.pdf (accessed on 29 August 2025).
- Lin, J.; Li, X.; Hoe, S.C.; Yan, Z. A Generalized Finite Difference Method for Solving Hamilton–Jacobi–Bellman Equations in Optimal Investment. Mathematics 2023, 11, 2346. [Google Scholar] [CrossRef]
- Yuan, W.; Liu, H.; Liang, L.; Wang, W. Learning the Hybrid Nonlocal Self-Similarity Prior for Image Restoration. Mathematics 2024, 12, 1412. [Google Scholar] [CrossRef]
- Park, J.; Lee, S.; Kim, M. Improving Rebar Twist Prediction Exploiting Unified-Channel Attention-Based Image Restoration and Regression Techniques. Sensors 2024, 24, 4757. [Google Scholar] [CrossRef] [PubMed]
- Bressan, A.; Jiang, Z. The vanishing viscosity limit for a system of H-J equations related to a debt management problem. Discret. Contin. Dyn. Syst. S 2018, 11, 793–824. [Google Scholar] [CrossRef]
- Camilli, F.; Marchi, C.; Schieborn, D. The vanishing viscosity limit for Hamilton–Jacobi equations on networks. J. Differ. Equ. 2013, 254, 4122–4143. [Google Scholar] [CrossRef]
- Covei, D.-P. Existence theorems for equations and systems in ℝN with ki Hessian operator. Miskolc Math. Notes 2023, 24, 1273–1286. [Google Scholar] [CrossRef]
- Fleming, W.H.; Soner, H.M. Controlled Markov Processes and Viscosity Solutions, 2nd ed.; Springer: New York, NY, USA, 2006. [Google Scholar]
- Covei, D.-P. Stochastic Production Planning with Regime-Switching: Sensitivity Analysis, Optimal Control, and Numerical Implementation. Axioms 2025, 14, 524. [Google Scholar] [CrossRef]
Cost Function | Image | PSNR | SSIM | MSE | Image | PSNR | SSIM | MSE |
---|---|---|---|---|---|---|---|---|
Restored | 51.26 | 0.99 | 0.26 | Denoised | 31.01 | 0.79 | 51.42 | |
Restored | 30.32 | 0.97 | 59.98 | Denoised | 28.85 | 0.80 | 84.60 |
Cost Function | Image | PSNR | SSIM | MSE | Image | PSNR | SSIM | MSE |
---|---|---|---|---|---|---|---|---|
Restored | 12.50 | 0.48 | 3656.51 | Denoised | 12.83 | 0.55 | 3385.33 | |
Restored | 8.67 | 0.32 | 8819.23 | Denoised | 9.10 | 0.34 | 7989.2 |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2025 by the author. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Covei, D.-P. Image Restoration via the Integration of Optimal Control Techniques and the Hamilton–Jacobi–Bellman Equation. Mathematics 2025, 13, 3137. https://doi.org/10.3390/math13193137
Covei D-P. Image Restoration via the Integration of Optimal Control Techniques and the Hamilton–Jacobi–Bellman Equation. Mathematics. 2025; 13(19):3137. https://doi.org/10.3390/math13193137
Chicago/Turabian StyleCovei, Dragos-Patru. 2025. "Image Restoration via the Integration of Optimal Control Techniques and the Hamilton–Jacobi–Bellman Equation" Mathematics 13, no. 19: 3137. https://doi.org/10.3390/math13193137
APA StyleCovei, D.-P. (2025). Image Restoration via the Integration of Optimal Control Techniques and the Hamilton–Jacobi–Bellman Equation. Mathematics, 13(19), 3137. https://doi.org/10.3390/math13193137