Explain conv1D operation over an image
Anónimo
Applying Conv1D to an Image An image is a 2D structure with shape ( ℎ 𝑒 𝑖 𝑔 ℎ 𝑡 , 𝑤 𝑖 𝑑 𝑡 ℎ , 𝑐 ℎ 𝑎 𝑛 𝑛 𝑒 𝑙 𝑠 ) (height,width,channels). Applying Conv1D to an image means treating the width (columns) as a sequence while ignoring the height. This is typically done in two ways: Case 1: Conv1D Along the Width (Common Approach) The input image has shape ( ℎ 𝑒 𝑖 𝑔 ℎ 𝑡 , 𝑤 𝑖 𝑑 𝑡 ℎ , 𝑐 ℎ 𝑎 𝑛 𝑛 𝑒 𝑙 𝑠 ) (height,width,channels). The Conv1D kernel moves along the width (columns). This extracts features along horizontal structures. Output shape: ( ℎ 𝑒 𝑖 𝑔 ℎ 𝑡 , 𝑛 𝑒 𝑤 _ 𝑤 𝑖 𝑑 𝑡 ℎ , 𝑓 𝑖 𝑙 𝑡 𝑒 𝑟 𝑠 ) (height,new_width,filters). Case 2: Conv1D Along the Height (Alternative Approach) We can reshape the image so that height is treated as width: ( 𝑤 𝑖 𝑑 𝑡 ℎ , ℎ 𝑒 𝑖 𝑔 ℎ 𝑡 , 𝑐 ℎ 𝑎 𝑛 𝑛 𝑒 𝑙 𝑠 ) (width,height,channels). The Conv1D kernel slides vertically across the height. Output shape: ( 𝑤 𝑖 𝑑 𝑡 ℎ , 𝑛 𝑒 𝑤 _ ℎ 𝑒 𝑖 𝑔 ℎ 𝑡 , 𝑓 𝑖 𝑙 𝑡 𝑒 𝑟 𝑠 ) (width,new_height,filters).