[{"data":1,"prerenderedAt":412},["ShallowReactive",2],{"content-query-gaqIcJ8jdR":3},{"_path":4,"_dir":5,"_draft":6,"_partial":6,"_locale":7,"title":8,"description":9,"date":10,"cover":11,"type":12,"category":13,"body":14,"_type":406,"_id":407,"_source":408,"_file":409,"_stem":410,"_extension":411},"/technology-blogs/en/1897","en",false,"","Idea Sharing (19): Practising Electromagnetic Inversion of Ground Penetrating Radars","We have made a preliminary exploration of the electromagnetic inverse problem and found that AI methods can effectively solve such problems.","2022-05-27","https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2022/09/30/ffba580fc0ad4c9cb198a4979de3d6f1.png","technology-blogs","Influencers",{"type":15,"children":16,"toc":403},"root",[17,25,30,35,43,48,53,58,63,70,75,99,181,193,198,203,208,213,218,223,228,233,238,243,248,253,258,263,270,275,280,290,295,314,321,326,331,338,343,348,353,358,363,375,386,391],{"type":18,"tag":19,"props":20,"children":22},"element","h1",{"id":21},"idea-sharing-19-practising-electromagnetic-inversion-of-ground-penetrating-radars",[23],{"type":24,"value":8},"text",{"type":18,"tag":26,"props":27,"children":28},"p",{},[29],{"type":24,"value":10},{"type":18,"tag":26,"props":31,"children":32},{},[33],{"type":24,"value":34},"Ground penetrating radars (GPRs) [1] provide a geophysical method of detecting the attributes and distribution of materials with antennas to transmit and receive high-frequency electromagnetic waves. Featuring high precision, high efficiency, and no destruction, the method has been applied in many fields including archaeology, mineral exploration, disaster geological investigation, geotechnical engineering investigation, engineering quality inspection, building structure inspection, and target detection. MindSpore Elec [2] has been focused on the forward problem: Knowing the structure and attributes of the target to be simulated, it calculates physical quantities such as electromagnetic fields and scattering parameters. The electromagnetic inversion of GPRs is a classical inverse problem, which deduces the structure and attributes of the target based on the received electromagnetic wave signal. When using traditional methods like noise suppression and time variable gain, researchers need to select proper methods and parameters based on different characteristics of the method and target. Therefore, researchers must be highly qualified and the expected effect is hard to achieve. This paper mainly introduces how to use the data-driven AI method of MindSpore Elec to solve the electromagnetic inverse problem of GPRs.",{"type":18,"tag":26,"props":36,"children":37},{},[38],{"type":18,"tag":39,"props":40,"children":42},"img",{"alt":7,"src":41},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2022/09/30/b0b2cb29d0a44835b9610208cf712bc6.png",[],{"type":18,"tag":26,"props":44,"children":45},{},[46],{"type":24,"value":47},"Figure 1 Principle of detection with GPRs",{"type":18,"tag":26,"props":49,"children":50},{},[51],{"type":24,"value":52},"MindSpore Elec Electromagnetic Inversion Practice",{"type":18,"tag":26,"props":54,"children":55},{},[56],{"type":24,"value":57},"1. Data Generation",{"type":18,"tag":26,"props":59,"children":60},{},[61],{"type":24,"value":62},"gprMax[3] is traditional open-source electromagnetic simulation software based on Finite-Difference Time-Domain (FDTD). It can be used for modeling and solving for GPRs' forward problems. Therefore, gprMax is used to generate data for training and inference.",{"type":18,"tag":26,"props":64,"children":65},{},[66],{"type":18,"tag":39,"props":67,"children":69},{"alt":7,"src":68},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2022/09/30/8a6e65f3e93a4714a86ef8d3171651ad.png",[],{"type":18,"tag":26,"props":71,"children":72},{},[73],{"type":24,"value":74},"Figure 2 cylinder_Ascan_2D model",{"type":18,"tag":26,"props":76,"children":77},{},[78,80,86,88,97],{"type":24,"value":79},"First, install the gprMax 3.1.5 open-source software. The ",{"type":18,"tag":81,"props":82,"children":83},"strong",{},[84],{"type":24,"value":85},"user_models",{"type":24,"value":87}," directory in the gprMax source code provides the basic application model of the GPR. Here, we use the ",{"type":18,"tag":89,"props":90,"children":94},"a",{"href":91,"rel":92},"https://link.zhihu.com/?target=http%20%3A//cylinder_Ascan_2D.in",[93],"nofollow",[95],{"type":24,"value":96},"http://cylinder_Ascan_2D.in",{"type":24,"value":98}," model.",{"type":18,"tag":26,"props":100,"children":101},{},[102,104,109,111,116,118,123,125,130,132,137,139,144,146,151,153,158,160,165,167,172,174,179],{"type":24,"value":103},"Figure 2 shows the general process of this model: The transmitter emits electromagnetic waves, and when the electromagnetic waves reach the metal cylinder, the signals are reflected back to the receiver. Users infer the position of the metal cylinder based on the received electromagnetic signals. In the ",{"type":18,"tag":89,"props":105,"children":107},{"href":91,"rel":106},[93],[108],{"type":24,"value":96},{"type":24,"value":110}," file, ",{"type":18,"tag":81,"props":112,"children":113},{},[114],{"type":24,"value":115},"#domain",{"type":24,"value":117}," indicates the simulation area (x, y, and z, in meters), ",{"type":18,"tag":81,"props":119,"children":120},{},[121],{"type":24,"value":122},"#dx_dy_dz",{"type":24,"value":124}," indicates the grid size (in meters), ",{"type":18,"tag":81,"props":126,"children":127},{},[128],{"type":24,"value":129},"#time_window",{"type":24,"value":131}," indicates the simulation time (in seconds), ",{"type":18,"tag":81,"props":133,"children":134},{},[135],{"type":24,"value":136},"#material",{"type":24,"value":138}," indicates the model attribute, ",{"type":18,"tag":81,"props":140,"children":141},{},[142],{"type":24,"value":143},"#waveform",{"type":24,"value":145}," indicates the waveform (amplitude and frequency) of the transmit source, ",{"type":18,"tag":81,"props":147,"children":148},{},[149],{"type":24,"value":150},"#hertzian_dipole",{"type":24,"value":152}," indicates the position of the transmit source, ",{"type":18,"tag":81,"props":154,"children":155},{},[156],{"type":24,"value":157},"#rx",{"type":24,"value":159}," indicates the position of the receive source, ",{"type":18,"tag":81,"props":161,"children":162},{},[163],{"type":24,"value":164},"#box",{"type":24,"value":166}," indicates the background medium, ",{"type":18,"tag":81,"props":168,"children":169},{},[170],{"type":24,"value":171},"#cylinder",{"type":24,"value":173}," indicates the position and material attribute of the metal cylinder, and ",{"type":18,"tag":81,"props":175,"children":176},{},[177],{"type":24,"value":178},"#geometry_view",{"type":24,"value":180}," exports the geometric information of the model to a file. For details, see [4] and [5].",{"type":18,"tag":26,"props":182,"children":183},{},[184,191],{"type":18,"tag":89,"props":185,"children":188},{"href":186,"rel":187},"http://cylinder%5C_Ascan%5C_2D.in",[93],[189],{"type":24,"value":190},"http://cylinder\\_Ascan\\_2D.in",{"type":24,"value":192}," file:",{"type":18,"tag":26,"props":194,"children":195},{},[196],{"type":24,"value":197},"#title: A-scan from a metal cylinder buried in a dielectric half-space",{"type":18,"tag":26,"props":199,"children":200},{},[201],{"type":24,"value":202},"#domain: 0.240 0.210 0.002",{"type":18,"tag":26,"props":204,"children":205},{},[206],{"type":24,"value":207},"#dx_dy_dz: 0.002 0.002 0.002",{"type":18,"tag":26,"props":209,"children":210},{},[211],{"type":24,"value":212},"#time_window: 3e-9",{"type":18,"tag":26,"props":214,"children":215},{},[216],{"type":24,"value":217},"#material: 6 0 1 0 half_space",{"type":18,"tag":26,"props":219,"children":220},{},[221],{"type":24,"value":222},"#waveform: ricker 1 1.5e9 my_ricker",{"type":18,"tag":26,"props":224,"children":225},{},[226],{"type":24,"value":227},"#hertzian_dipole: z 0.100 0.170 0 my_ricker",{"type":18,"tag":26,"props":229,"children":230},{},[231],{"type":24,"value":232},"#rx: 0.140 0.170 0",{"type":18,"tag":26,"props":234,"children":235},{},[236],{"type":24,"value":237},"#box: 0 0 0 0.240 0.170 0.002 half_space",{"type":18,"tag":26,"props":239,"children":240},{},[241],{"type":24,"value":242},"#cylinder: 0.120 0.080 0 0.120 0.080 0.002 0.010 pec",{"type":18,"tag":26,"props":244,"children":245},{},[246],{"type":24,"value":247},"#geometry_view: 0 0 0 0.240 0.210 0.002 0.002 0.002 0.002 cylinder_half_space n",{"type":18,"tag":26,"props":249,"children":250},{},[251],{"type":24,"value":252},"Second, by moving the position of the metal cylinder (other conditions remain unchanged), we generated more than 300 sample data records.",{"type":18,"tag":26,"props":254,"children":255},{},[256],{"type":24,"value":257},"2. Modeling and Training",{"type":18,"tag":26,"props":259,"children":260},{},[261],{"type":24,"value":262},"It is concluded from the results of the forward problem that, the Ez, Hx, and Hy electromagnetic field components play a role in the two-dimensional electromagnetic issue. Therefore, we construct a neural network mapping from Ez, Hx, Hy to the position of the metal cylinder, that is, cylinder_pos ([x, y]) = Net ([Ez, Hx, Hy]).",{"type":18,"tag":26,"props":264,"children":265},{},[266],{"type":18,"tag":39,"props":267,"children":269},{"alt":7,"src":268},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2022/09/30/fcd0aaf676f14352b43e063d769bd9a8.png",[],{"type":18,"tag":26,"props":271,"children":272},{},[273],{"type":24,"value":274},"Figure 3 Forward results of electromagnetic exploration",{"type":18,"tag":26,"props":276,"children":277},{},[278],{"type":24,"value":279},"The neural network model is described as follows:",{"type":18,"tag":281,"props":282,"children":284},"pre",{"code":283},"class Model(nn.Cell):\n\n    def __init__(self):\n\n        super(Model,self).__init__()\n\n        self.conv1 = nn.Conv1d(3,10,3)\n\n        self.relu = nn.ReLU()\n\n        self.maxpool = nn.MaxPool1d(2,2)\n\n        self.conv2 = nn.Conv1d(10,32,3)\n\n        self.tanh = nn.Tanh()\n\n        self.conv3 = nn.Conv1d(32,64,3)\n\n        self.fc1 = nn.Dense(5056,1200)\n\n        self.fc2 = nn.Dense(1200,100)\n\n        self.fc3 = nn.Dense(100,2)\n\n        self.reshape = ops.Reshape()\n\n    def construct(self,x):\n\n        x1 = self.relu(self.conv1(x))\n\n        x2 = self.maxpool(x1)\n\n        x3 = self.tanh(self.conv2(x2))\n\n        x3 = self.maxpool(x3)\n\n        x4 = self.relu(self.conv3(x3))\n\n        x4 = self.maxpool(x4)\n\n        x5 = self.reshape(x4, (x.shape[0],-1))\n\n        x6 = self.relu(self.fc1(x5))\n\n        x7 = self.fc2(x6)\n\n        output = self.fc3(x7)\n\n        return output\n",[285],{"type":18,"tag":286,"props":287,"children":288},"code",{"__ignoreMap":7},[289],{"type":24,"value":283},{"type":18,"tag":26,"props":291,"children":292},{},[293],{"type":24,"value":294},"3. Result",{"type":18,"tag":26,"props":296,"children":297},{},[298,300,305,307,312],{"type":24,"value":299},"Figure 4 shows the training result, where ",{"type":18,"tag":81,"props":301,"children":302},{},[303],{"type":24,"value":304},"X_pos",{"type":24,"value":306}," and ",{"type":18,"tag":81,"props":308,"children":309},{},[310],{"type":24,"value":311},"Y_pos",{"type":24,"value":313}," are respectively the horizontal and vertical coordinates of the metal cylinder. The training loss can reach 2.6 x 10–6, and the relative error reaches 8.7 x 10–3.",{"type":18,"tag":26,"props":315,"children":316},{},[317],{"type":18,"tag":39,"props":318,"children":320},{"alt":7,"src":319},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2022/09/30/2561e33fac9644e8a8d2113cb73fd04a.png",[],{"type":18,"tag":26,"props":322,"children":323},{},[324],{"type":24,"value":325},"Figure 4 AI training result",{"type":18,"tag":26,"props":327,"children":328},{},[329],{"type":24,"value":330},"Figure 5 shows the inference result. The inference loss reaches 10–4, and the relative error reaches 5 x 10–2.",{"type":18,"tag":26,"props":332,"children":333},{},[334],{"type":18,"tag":39,"props":335,"children":337},{"alt":7,"src":336},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2022/09/30/f26f87d9008d40458982fa890f9356f6.png",[],{"type":18,"tag":26,"props":339,"children":340},{},[341],{"type":24,"value":342},"Figure 5 AI inference result",{"type":18,"tag":26,"props":344,"children":345},{},[346],{"type":24,"value":347},"Summary and Prospects",{"type":18,"tag":26,"props":349,"children":350},{},[351],{"type":24,"value":352},"We have made a preliminary exploration of the electromagnetic inverse problem and found that AI methods can effectively solve such problems. Later, we will open the codes above in the MindSpore Elc repository and further study more complex scenarios. Anyone interested in AI electromagnetic simulation is welcome to join us to explore this topic.",{"type":18,"tag":26,"props":354,"children":355},{},[356],{"type":24,"value":357},"References:",{"type":18,"tag":26,"props":359,"children":360},{},[361],{"type":24,"value":362},"1. Study on Spectrum Characteristics of Ground Penetrating Radars in Water-Rich Crushed Zone in Karst Area",{"type":18,"tag":26,"props":364,"children":365},{},[366,368],{"type":24,"value":367},"2. ",{"type":18,"tag":89,"props":369,"children":372},{"href":370,"rel":371},"https://link.zhihu.com/?target=https%3A//gitee.com/mindspore/mindscience/tree/master/MindElec",[93],[373],{"type":24,"value":374},"MindSpore/mindscience",{"type":18,"tag":26,"props":376,"children":377},{},[378,380],{"type":24,"value":379},"3. ",{"type":18,"tag":89,"props":381,"children":384},{"href":382,"rel":383},"https://github.com/gprMax/gprMax",[93],[385],{"type":24,"value":382},{"type":18,"tag":26,"props":387,"children":388},{},[389],{"type":24,"value":390},"4. Introductory (2D) models",{"type":18,"tag":26,"props":392,"children":393},{},[394,396],{"type":24,"value":395},"5. ",{"type":18,"tag":89,"props":397,"children":400},{"href":398,"rel":399},"https://link.zhihu.com/?target=https%20%3A//blog.csdn.net/Neverlevsun/article/details/116058711",[93],[401],{"type":24,"value":402},"gprMax 3.1.5 Compiling the IN File for Modeling (1)",{"title":7,"searchDepth":404,"depth":404,"links":405},4,[],"markdown","content:technology-blogs:en:1897.md","content","technology-blogs/en/1897.md","technology-blogs/en/1897","md",1776506105783]