arXiv:2609.08387cs.CESep 2026

Manuscript Offprint

arXiv:2609.08387

Risk-Aware Generative Inpainting for Optimized Design Editing of EV Battery Cooling Channels

Leekyo Jeong, Yoon Koo Lee, Namwoo Kang

Abstract

Cooling-channel layouts for electric-vehicle battery packs must deliver temperature uniformity and low pressure drop while maintaining a single continuous channel. In late-stage design, local topology modification offers a practical way to improve performance while retaining established global features. Diffusion-based inpainting naturally accommodates such local edits, but its stochastic nature can produce different outcomes even when applied to the same region. This variability poses a fundamental question: how should edit locations be selected when the outcome of each modification is stochastic? We propose a risk-aware generative editing framework that incorporates this variability into the selection of edit locations. Instead of scoring each candidate location by a single expected improvement, the method estimates a distribution of possible outcomes from offline edit results evaluated using a computational-fluid-dynamics (CFD)-trained surrogate and ranks locations according to a chosen level of risk. A single trained model therefore supports different editing preferences at inference time, emphasizing either higher expected improvement or greater consistency without retraining. The policy is evaluated against random editing in a held-out paired study across seven mask configurations. It improves the cooling-channel objective over random editing in most configurations, and the advantage is retained under independent CFD verification of the edited designs. Varying the risk level reveals a consistent trade-off between mean improvement and run-to-run consistency, while the learned distribution is useful for ranking locations but should not be interpreted as a calibrated probability distribution. Together, these results show that stochastic generative editing can be converted from a source of variability into a controllable design decision through risk-aware location selection: effective editing depends not only on how a design is modified, but also on where it is modified and how much outcome variability is acceptable.

Keywords: Cooling channel design, Distributional value regression, Diffusion model, Inpainting, Risk-sensitive design, Surrogate model, Design editing

*Corresponding author. Email addresses: leekyoj@kaist.ac.kr (Leekyo Jeong), nwkang@kaist.ac.kr (Namwoo Kang)

1. Introduction

Many engineering design problems can be formulated as iterative refinement processes in which an existing feasible solution is progressively modified to improve its performance. Rather than replacing the entire design at each iteration, selected regions can be modified while satisfactory portions of the current solution are retained. This formulation introduces a decision problem at each iteration: which region should be modified, and what modification should be considered at that location?

The problem becomes more challenging when a given location admits multiple plausible modifications. A single region may admit alternative modifications with substantially different design outcomes. Consequently, selecting the next edit requires comparing candidate locations while accounting for the range of outcomes that their possible modifications may produce. Generative models provide a natural mechanism for exploring such alternatives (Regenwetter et al., 2022), since a local region can be regenerated into multiple plausible configurations while the remainder of the design is preserved.

Electric-vehicle (EV) battery cooling-channel design provides a representative engineering setting for this problem. Thermal management is a central constraint in the design of EV battery packs and high-power electronics — ambient and operating-temperature extremes alone can shift an EV's usable driving range by tens of percent (Yuksel & Michalek, 2015) — and embedded cooling channels have to provide low and uniform component temperatures, small pressure drop, and a manufacturable layout at once. Cooling-channel layouts are discrete connected topologies, and improving an existing layout can be formulated as a sequence of local modifications: a region is selected, edited, and evaluated while the remainder of the layout is retained. Each such edit must honour a single-stroke connectivity constraint (one continuous channel, a manufacturing requirement) that classical adjoint topology optimization and parametric optimization both handle poorly on a discrete pixel grid. Importantly, these constraints define the feasible engineering design space rather than merely restricting the optimization problem. Accordingly, the key challenge is not to remove these constraints, but to efficiently identify promising edit locations within the feasible space.

Diffusion-based inpainting instantiated this local-editing mechanism directly: masking a selected region and regenerating its contents can modify part of an existing channel while preserving the surrounding design, and diffusion-based generators in particular (Ho et al., 2020) can synthesize completions that already satisfy the single-stroke topology. These generators are stochastic, however: the same edit mask produces different completions on every run. Two questions follow at once: (i) which edit sites deserve an inpainting call in the first place, and (ii) how should an agent cope with that per-call stochasticity?

Both questions are answered here with the same mechanism: a distributional value function that scores each candidate edit site by its outcome distribution, not its expected value alone. This is the outlook of distributional reinforcement learning (RL), which supports risk-sensitive decisions that act on the tails of the distribution instead of its mean alone (reviewed in §2.3). Within that family of architectures we adopt the implicit quantile network (IQN), which can be queried at an arbitrary probability τ\tau without committing to any fixed set of quantile fractions (Dabney et al., 2018a), so one trained network exposes a whole family of risk-sensitive policies through the value of τ\tau alone.

IQN is conventionally trained end-to-end by sequential reinforcement learning: temporal-difference (TD) learning with a bootstrapped target, n-step returns, and a replay buffer. For this editing task we found that the paradigm degrades the learned distribution ( §5.3.5§5.3.5), so we dropped it while keeping IQN's query interface.

In this study, diffusion inpainting serves as the edit primitive of a design-editing agent for cooling-channel skeletons. A frozen ridge-regression term on five geometric path features is combined with a τ\tau-conditioned residual network, both fit by supervised regression on offline-labelled edit outcomes with no bootstrapping or replay; at inference, every candidate edit site is scored once and visited in that fixed order for a fixed number of steps, a deterministic single-pass policy, with τ\tau the inference-time risk dial detailed in the contributions below. The policy beats random editing across most mask configurations under a pre-registered evaluation protocol, an advantage that survives independent CFD verification and is not explained by surrogate scoring error, at a measurable cost in seed-to-seed consistency and in how faithfully the learned distribution calibrates as a probability object. Comparisons of this kind also face two confounds invisible to ordinary testing — an input-convention mismatch that silently decorrelates the training objective from ground truth, and a rollout-seed dependence that leaves any single-realization number an incomplete summary of the effect ( §5.3.1§5.3.1) — both measured and reported throughout this study.

Existing approaches primarily optimize or generate designs, whereas our framework addresses the decision of where to perform a stochastic local generative edit on an already feasible topology. This study makes four contributions:

  1. A single inference-time risk dial τ\tau that moves the deployed policy along a mean-improvement/seed-to-seed-consistency frontier without retraining. A mixed-effects decomposition locates the measurable benefit in this dial: the effect is robust across a three-seed IQN-vs-FQF comparison, and provisional for the single-seed DQN and ridge-only arms ( §S1§S1).

  2. A held-out, paired evaluation of the trained policy against random editing across seven mask configurations, with effect sizes reported both at a pre-registered rollout seed and averaged over independent rollout seeds. We evaluate against random editing only; comparison against a published cooling-channel RL agent (Kim & Han, 2023) was judged out of scope because its action space and training code are not directly transferable ( §2.1§2.1).

  3. A CFD-verified fidelity study of the surrogate objective that drives training: high decision-level agreement with CFD within the deployment range, and no statistical association between the measured policy advantage (Contribution 2) and surrogate scoring error, evidence against reward exploitation as an explanation for that advantage.

  4. A methodological account, null results included, of what the risk-conditioned quantile function can and cannot do: a temporal-difference-trained version is measurably worse-calibrated than the same architecture trained by supervised regression, and even the supervised version, useful for ranking edit sites, fails a standard calibration test structurally and must not be read as a calibrated probability distribution.

Because diffusion sampling introduces substantial rollout-level stochasticity, we explicitly evaluate the policy across independent rollout seeds rather than relying on a single realization.

The rest of the paper runs as follows. Section 2 reviews related work in cooling-channel design optimization, generative models for engineering design, and distributional reinforcement learning.

Section 3 presents the proposed three-stage system, first as a whole and then stage by stage: the objective, the surrogate evaluator, the inpainting edit operator, and the learned position-value policy. Section 4 describes the experimental setup: data generation, the surrogate model, and the evaluation protocol. Section 5 presents the measurements stage by stage, from surrogate fidelity (Stage 1) and what iterative inpainting search achieves without a learned policy (Stage 2) to the learned policy itself (Stage 3), covering held-out improvement and its rollout-seed dependence, a factor decomposition of where the benefit lives, CFD verification on edited designs, the comparison against TD training, and the calibration tests. Section 6 interprets these findings and states the limitations, and Section 7 concludes.

References (37)