Skip to main content

Python implementation of the Pulse Coupled Neural Network (PCNN)

Project description

PCNN

Python implementation of the Pulse Coupled Neural Network (PCNN) alongside multiple variations:

  • Classical PCNN
  • Feature Linking Model (FLM)
  • Intersecting Cortical Model (ICM)
  • Multi Linking Model (MLM)
  • Spiking Cortical Model (SCM)
  • Sigmoidal Linking Model (SLM)

Install:

pip install pulse_coupled_nn

Usage example:

import numpy as np
import matplotlib.pyplot as plt

from pulse_coupled_nn import FLM
from pulse_coupled_nn import ICM
from pulse_coupled_nn import ClassicalPCNN
from pulse_coupled_nn import SCM
from pulse_coupled_nn import SLM


def run_image_segm(gamma=1, beta=2, v_theta=400, kernel_size=3, kernel='gaussian'):

    image = np.array(
        [[230, 230, 230, 230, 115, 115, 115, 115],
        [230, 230, 230, 230, 115, 115, 115, 115],
        [230, 230, 205, 205, 103, 103, 115, 115],
        [230, 230, 205, 205, 103, 103, 115, 115],
        [230, 230, 205, 205, 103, 103, 115, 115],
        [230, 230, 230, 230, 115, 115, 115, 115],
        [230, 230, 230, 230, 115, 115, 115, 115]]
    )

    model = ClassicalPCNN(image.shape, kernel, kernel_size=kernel_size)
    segm_image = model.segment_image(image, gamma=gamma, beta=beta, v_theta=v_theta, kernel_type='gaussian')

    plt.imshow(image)
    plt.colorbar()
    plt.show()

    plt.imshow(segm_image)
    plt.colorbar()
    plt.show()


run_image_segm()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pulse_coupled_nn-0.0.6.tar.gz (6.4 kB view hashes)

Uploaded Source

Built Distribution

pulse_coupled_nn-0.0.6-py3-none-any.whl (19.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page