ar4 / deepwave

Wave propagation modules for PyTorch.
MIT License
198 stars 46 forks source link

Add a variable density acoustic propagator #3

Closed ar4 closed 1 year ago

ar4 commented 6 years ago

Deepwave currently only contains a constant density acoustic (scalar) propagator. Creating a new propagator (perhaps called 'acoustic') would benefit some users. There will probably be significant code overlap with the scalar propagator, so some restructuring may be necessary to avoid repetition (probably creating a Propagator base class that both inherit from).

ar4 commented 1 year ago

Deepwave now also includes scalar_born and elastic propagators. I think the need for a variable density propagator is thus less pressing, so I am going to close this Issue for now.

haoopan commented 8 months ago

Dear Alan,

Deepwave is a great job and I'm using it in the field of ultrasonic nondestructive testing. I found that the scalar wave equation only included the velocity parameter v. So I want to ask, what should I do if I want to invert density parameter in scalar wave equations? I‘m looking forward to your reply.

Sincerely, Hao Pan

ar4 commented 8 months ago

Dear Hao,

I am delighted to hear that you find Deepwave useful. Thank you for writing to me with your question about inverting for density. As you may know, Deepwave currently only contains scalar, scalar Born, and elastic propagators. I initially intended to also add a variable density acoustic propagator, but have unfortunately not yet had time to implement it. Is it possible that the elastic propagator, which contains a buoyancy (1/density) parameter might be useful to you?

haoopan commented 8 months ago

Dear Alan,

Thank you for your reply to my questions. In the field of ultrasonic non-destructive testing, there is a significant difference between the sound speed of the medium and the defect. For example, the sound speed of the medium is 5850m/s, and the sound speed of the defect is 1500m/s. In addition, the center frequency of the signal is also very high, such as 5000000Hz. When inverting the velocity, the results are often poor. Some papers have suggested that inverting the density will give better results, so I am trying it. I have used the elastic propagator you implemented to invert density, but the results are still not good. Perhaps it was my negligence in some aspects, or it could be the presence of crosstalk among multiple parameters in the elastic propagator.

Sincerely, Hao Pan

ar4 commented 8 months ago

Dear Hao,

Thank you for the clear and interesting explanation.

Is the defect small enough, and knowledge of the background medium sufficiently good, that you wish to only invert for density, leaving velocity constant?

Have you tried using the scalar Born propagator? Perhaps the scattering potential could achieve similar results to a variable density inversion, if you don't expect there to be substantial multiple scattering. The Born propagator in Deepwave allows you to simultaneously invert for both scattering potential and velocity, or just one of them, if you wish.

haoopan commented 8 months ago

Dear Alan,

Thank you for your help and valuable advice. As you said, defects are often relatively small, and the background medium is generally fixed velocity and density. I want to only invert density and keep the velocity constant.

I will try the scalar born propagator right away. Thanks again for your advice!

Sincerely, Hao Pan

ar4 commented 8 months ago

I hope that you will find the Born propagator useful. Please let me know if you have any problems with it or if you would like me to check your code.

Since you only wish to invert for the density, when you tried using the elastic propagator did you only optimise the buoyancy parameter, leaving lamda and mu constant? I imagine that such a single parameter inversion should avoid problems of crosstalk.

haoopan commented 8 months ago

Dear Alan,

Thank you for your patient guidance all the time. According to your suggestion, I have tried scalar born propagator and elastic propagator respectively in these two days.

In scalar born propagator, I set the velocity as a constant, inverting the scattering potential. It can be seen from the inversion results of scattering potential that the specific location of the defect can be obtained, but the shape and size of the defect are not accurate enough, and there are obvious ripples at the defect. But this is much better than the velocity inversion results from scalar propagator!

In elastic propagator, I set the P-wave velocity to constant and the S-wave velocity to zero, inverting only the density. By combining physics-informed neural networks(PINN), I can get very perfect density inversion results, and convergence is very fast. However, there is a problem that the signal simulated by the elastic propagator is somewhat different from the actual signal collected by the probe. So I'm worried that when I invert with the measured signal, the result will still be poor. I'll do this experiment later.

Anyway, the current simulation has achieved a good result, thanks again for your help!

Sincerely, Hao Pan

ar4 commented 8 months ago

Dear Hao,

I am very glad to hear that you managed to obtain a good result.

Attempting to apply FWI to real data is indeed challenging. Deepwave can also invert for source amplitudes, so that might help to make the source wavelet closer to that of the real data, but perhaps being 2D propagation will pose a problem. I wish you good luck, and invite you to write to me @.***) if you have further questions.