Thursday, August 1, 2019


Non-Destructive Method for Segregation of Silkworm-Cocoons Using Deep Learning


The textile industry plays a major role in the economy of India. Silk is an integral part of this industry. The raw material for the production of the silk-fiber is Silkworm cocoons. In one of the life-cycle stages of the silkworm, the caterpillar spins a cocoon of silk around itself which is commonly known as silkworm cocoon.
Defects are caused in the silkworm cocoons due to some external and internal factors which affect the quality of the silk produced. At present defective cocoons are segregated by visual inspection which is a labor-intensive and cumbersome process.

To automate this process, we have developed a method to separate the defective cocoons from the good ones using Deep Learning.

Convolution Neural Network (CNN) is a class of deep neural networks that is commonly used for image classification, image recognition, and object detection. To train any deep neural network, the data-set plays a major role. 

We prepared a small data-set by capturing images of Defective cocoons(figure 1) and Non-Defective cocoons (figure 2) from a nearby grainage center.
 figure 1. NON-DEFECTIVE COCOONS

figure 2. DEFECTIVE COCOONS

Since our data-set was small we used a pre-trained neural network for our deep learning model. We used MATLAB DEEP LEARNING TOOLBOX to train the network on data-set because of its ease of use and more friendly user interface.

To use our trained model in python environment, we exported the deep learning model to ONNX format in MATLAB, which acts as a bridge to export and import deep learning models from one environment to another environment. Then imported the ONNX model to python environment using different python modules.

For the hardware implementation, we used Raspberry pi, a camera, ultrasonic sensor, and servo motor to demonstrate our method.
Raspberry Pi

The ultrasonic sensor was used to detect the presence of cocoons in front of the camera.
Ultrasonic Sensor Set-up

The camera is used to capture images for prediction and it is fed to the model after resizing according to the model input requirement. 
Camera Set-up

Servo motor is used to deflect the cocoon in a particular direction based on the prediction of deep learning model. 
Servo motor

So finally, When the program is run, the program continuously monitors the ultrasonic sensor reading, any deviation from a particular set value will send a signal to the camera to capture the image and send it for prediction.

Based on the result of prediction from deep learning model, the servo motor is actuated to deflect the cocoons in a particular direction and this process repeats. This process is depicted in the below flowchart(figure 3).


FUTURE SCOPE

  • Increasing accuracy by training the model with a larger data set.
    There is a saying that “a neural network is as good as data set it is trained on”.
  • Integrating with IoT to monitor and control the whole segregation process.
  • Use of high-end processors and GPU to reduce computational time.
  • Using multiple cameras to capture the complete surface image of the cocoon for better segregation

Non-Destructive Method for Segregation of Silkworm-Cocoons Using Deep Learning The textile industry plays a major role in the eco...