Answers.Body: <p>I think you can directly input <code>(64, 1024, 5)</code> shaped data into the model</p>
  <ol>
  <li>as long as the model(U-Net)'s architecture assumes <strong>the same shape</strong>, which you can find from the first layer of the model</li>
  <li>and the data type is correct, for example, if your model expect <code>torch.Tensor</code>, but the data are still <code>nd.array</code>, it would throw an error</li>
  <li>and as for the pre-processing, actually the above one I mentioned could be one of the parts of pre-processing, but there are steps like <code>normalisation</code>, <code>data augmentation</code>(if you want) that could be involved in the pre-processing stage.</li>
  </ol>
  <p><em><strong>In summary</strong></em> as long as what the model assumes the input's shape and data type the same as what you're presenting to the model, there shouldn't be a technical problem at all.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-03-29T02:10:44.343Z
Answers.LastActivityDate: 2024-03-29T02:10:44.343Z
Answers.UserDisplayName: djmoon13
Body: <p>I had lidar 3D point cloud data from semantckitti. I want to perform Semantic Segmentation on the data using U-Net. I converted the 3d point cloud data into 2D using spherical conversion and saved the original point cloud data which was in (.bin format) into numpy arrays with dimensions as 64,1024,5 where: 64 = height , 1024 = width and 5 = xyz coordinates, Intensity and Distance from sensor of each point, in that order.</p>
  <p>I also projected the semantic information contained in the label files of point cloud(taken from yaml file of semantickitti), on 2D image plane and saved them in .png format with each pixel having depitcing the color of its respective class.</p>
  <p><strong>MY QUESTION IS:
  I have the multichannel numpy arrays with dimensions (64,1024,5) ,label images in .png format with dimensions (64,1024) as the input data for purposes of Training,validation and testing.
  How can i input this data in U-Net? Can i input the numpy array with (64,1024,5) directly in U-Net? or some processing needs to take place? Also do i need to perform one-hot encoding to my ground truth label images as they donot contain any additional information at the moment.</strong></p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-03-28T19:38:21.297Z
Comments.Text: Have you checked the input image dimension of recommended training dataset of the U-Net?
Comments.UserDisplayName: Cloud Cho
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-03-28T19:44:18.947Z
Comments.Text: Have you checked the input image dimension of recommended training dataset of the U-Net? Also it looks like your last dimension is different from the regular image like RGB. I wonder if the neural network could handle the extra information. You may need change the model structure.  By the way, you may consider different 3D to 2D conversion like slicing because your height and width doesn't represent  2D surface. Where do you get idea of spherical conversion?
Comments.UserDisplayName: Cloud Cho
Tags: <neural-networks><deep-learning><tensorflow><u-net><semantic-segmentation>
Title: How do I input multi-channel Numpy array to U-net for semantic segmentation
UserDisplayName: Leibniz 24
ThreadText: # How do I input multi-channel Numpy array to U-net for semantic segmentation
  
  (Asked by: username_0 on 2024-03-28)
  
  I had lidar 3D point cloud data from semantckitti. I want to perform Semantic Segmentation on the data using U-Net. I converted the 3d point cloud data into 2D using spherical conversion and saved the original point cloud data which was in (.bin format) into numpy arrays with dimensions as 64,1024,5 where: 64 = height , 1024 = width and 5 = xyz coordinates, Intensity and Distance from sensor of each point, in that order.
  
  I also projected the semantic information contained in the label files of point cloud(taken from yaml file of semantickitti), on 2D image plane and saved them in .png format with each pixel having depitcing the color of its respective class.
  
  **MY QUESTION IS:
  I have the multichannel numpy arrays with dimensions (64,1024,5) ,label images in .png format with dimensions (64,1024) as the input data for purposes of Training,validation and testing.
  How can i input this data in U-Net? Can i input the numpy array with (64,1024,5) directly in U-Net? or some processing needs to take place? Also do i need to perform one-hot encoding to my ground truth label images as they donot contain any additional information at the moment.**
  
  **Tags:** neural-networks, deep-learning, tensorflow, u-net, semantic-segmentation
  > **Comments:**
  > **username_1**: Have you checked the input image dimension of recommended training dataset of the U-Net?  
  > **username_1**: Have you checked the input image dimension of recommended training dataset of the U-Net? Also it looks like your last dimension is different from the regular image like RGB. I wonder if the neural network could handle the extra information. You may need change the model structure.  By the way, you may consider different 3D to 2D conversion like slicing because your height and width doesn't represent  2D surface. Where do you get idea of spherical conversion?  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2024-03-29. Score: 0
  
  I think you can directly input `(64, 1024, 5)` shaped data into the model
  
  1. as long as the model(U-Net)'s architecture assumes **the same shape**, which you can find from the first layer of the model
  2. and the data type is correct, for example, if your model expect `torch.Tensor`, but the data are still `nd.array`, it would throw an error
  3. and as for the pre-processing, actually the above one I mentioned could be one of the parts of pre-processing, but there are steps like `normalisation`, `data augmentation`(if you want) that could be involved in the pre-processing stage.
  
  ***In summary*** as long as what the model assumes the input's shape and data type the same as what you're presenting to the model, there shouldn't be a technical problem at all.
  
  
  ---
  
  