TenSEAL icon indicating copy to clipboard operation
TenSEAL copied to clipboard

conv2D on images with more than 1 channel

Open elina-israyelyan opened this issue 2 years ago • 3 comments

Question

I want to know how I can do convolution on an image with 3 channels?

Further Information

So I am trying to use the ts.im2col_encoding function on each channel separately and then stack them with ts.CKKSVector.pack_vectors but I am getting an error like this: ValueError: output size is bigger than slot count

So how can I do that with more than 1 channels? also the forward method should be changed from the tutorial's version, right?

System Information

  • OS Version: Ubuntu 20.04
  • Language Version: Python 3.10

elina-israyelyan avatar Feb 20 '23 08:02 elina-israyelyan

Did you solve it?

maxwellgodv avatar Apr 11 '23 08:04 maxwellgodv

You probably get ValueError: output size is bigger than slot count because the polynomial modulus size is too small to fit all your channels in a single ciphertext.

youben11 avatar Apr 13 '23 13:04 youben11

I am working on CIFAR10 dataset recently, which contains 3 channels images, and I wonder how to use ts.im2col_encoding function and ts.Conv2d_im2col function on this kind of inputs?

Ombalv avatar May 06 '23 17:05 Ombalv