[ANN] Jello.jl - Manufacturable geometry generation for topology optimization & generative design

Hello friends Jello.jl uses a Fourier domain algorithm for generating manufacturable geometry for topology optimization & generative inverse design. Will take couple days for merging into general registry. Thanks :slight_smile:

8 Likes

Nice package and neat idea! I am hoping to integrate some of these ideas in TopOpt.jl if possible. Is there a publication I can read for the theory?

Thanks! I’m doing a preprint soon. Collaboration welcome. A simple way to interface with a mesh is to interpolate the density array. Some methods in Interpolations.jl work with AD. Here’re papers on Fourier geometry generation though ours presents some improvements:

2 Likes

Awesome, thanks for the references. I will give them a read.

Similar to filtering, using a Fourier representation is not sufficient to ensure manufacturability constraints like a minimum lengthscale — the reason is that once you do a nonlinear projection/thresholding step to binarize the structure, arbitrarily small features can re-appear. That’s why, even with filtering/smoothing, people concerned with manufacturability still impose explicit lengthscale constraints (e.g. see Hammond et al (2021) and references therein). Did you implement something similar?

1 Like

Thanks for the comment. While undesirably small features can appear during initialization, they usually disappear during adjoint optimization. The final result usually passes DRC. If not, we tune up the scale parameter or re-initialize, without explicit constraints. Fourier representations are inherently global and can kill off small features during gradient descent. Your reference takes the conventional approach of local morphological transforms.

Fourier representations are equivalent (in terms of what functions they allow) to starting with a position-space representation and low-pass filtering, no? So they should hit the same problem — once you threshold/project, the nonlinearity allows small features to re-appear unless you add explicit lengthscale constraints. If the optimization objective favors small features, gradient descent will push the design into this regime unless you constrain it.

1 Like

Yes the global optimum is the same but the local minima are very different as the gradients are wrt a different basis.

If the problem favors a smooth optimum, then our approach does well in not getting gnarled by checkerboard instability or minima.

If the problem favors sharp or fractal features, as you mentioned for narrow band resonant behavior, then they might get resurfaced by the nonlinearity. In such cases, maybe we can add a morphological opening/closing stage to ensure manufacturability.

1 Like

Pushed new version:

  • cleaned up API, use nbasis and contrast to control design complexity and edge sharpness
  • example compares Flux.Adam vs Optim.LBFGS. As with small models, ours trains substantially faster with LBFGS. Zygote AD is used in both cases
  • moderate complexity can be done with only dozens of params, marking suitability with gradient free (Optim already set up in example ) or Bayesian methods. Welcome to try
2 Likes

Realized Optim.LBFGS calls gradient 2-3 times per iteration so it’s not much faster than Flux.Adam
Better to use Flux because it’s simpler

Added optional morphological filtering to exactly eliminate small features while still maintaining adjoints. You can also pass in custom structuring elements for such (LMK and I can document this feature). Also remember that the pkg works in 3d as well. Install directly from repo for latest
image

2 Likes

How do you preserve differentiability through the morphological transforms (which aren’t differentiable)? Do you use “soft” versions?

Good question. I binarize the mask and apply morphological transforms. Then I apply the filtered binary mask to the original continuous mask which still retains adjoints.

Changed default algorithm to real space interpolation, which simply interpolates in between grid of trainable params whose spacing determines length scale . More similar behavior to conventional methods but with benefit of way fewer params. Original fourier alg is still accessible and good for periodic geometry