good bowel preparation is essential to produce a good - quality colonoscopy and it allows the detection of preneoplastic colon lesions 1 
 2 
 3 
 4 .
assessment of bowel preparation is entrusted to the endoscopist who is carrying out the endoscopy .
most bowel preparation scales have not been shown to be valid or reliable . moreover ,
the few bowel preparation scales that have been validated have significant limitations , including an inability to distinguish among bowel preparations that adequately cleanse a high percentage of colons 5 
 6 
 7 
 8 
 9 . in the last position paper of the european society of gastrointestinal endoscopy ( esge ) ,
hassan et al . drew up evidence- and consensus - based guidelines on bowel preparation for colonoscopy 10 .
the main problem during the review of all randomized controlled trials ( rcts ) and meta - analyses was that none of the studies were comparable in regard to scales for bowel cleansing .
this is because no valid , reliable , internationally - approved rating scale exists for evaluation of the quality of bowel cleansing .
some scales  such as the aronchic scale 5 , the ottawa scale 6 , the boston bowel - preparation scale 7 , the harefield cleansing scale 8 , and the chicago scale 9  have been proposed and validated , but they are difficult to apply in clinical practice and operator - dependent
.   a computer - assisted clean - colon scale would be an attractive alternative to the current proposed scales because it could potentially be a reliable and more objective rating scale un affected by the endoscopist .
the aims of our study are to create a software algorithm that is able to analyze bowel cleansing during colonoscopies and to correlate it with a scale for colon cleansing that has been validated .
the clean colon software program ( ccsp ) is a mathematical algorithm applicable to all personal computers that objectively analyzes bowel cleansing during colonoscopy examinations and results in a numerical scoring ( dupuis - rosa - rizzotto index   
video - recordings of colonoscopies were analyzed using a threshold analysis by a software program that first sampled a number of frames ( depending on a frequency parameter related to the length of the video ) and then each frame wa assessed to distinguish clean from dirty zones , as explained in fig .  1 .
( e.  g. , red , pink , violet ) were separated from the  dirty  ones ( e.  g. , yellow , brown or green ) . 

flowchart of the software program the threshold was that value which , compared with a precise calculation based on normalized red - green - blue ( rgb ) values , made possible a distinction between the two types of zones : clean and dirty ( fig .  2 ) .
rgb coloring is predicated on the physical principle that any spectral color can be generated by mixing the three basic colors .
for example , if red and green are mixed at full intensity , bright yellow is generated , whereas a mixture of red and blue results in violet . if the three basic colors are mixed at different intensities , the whole spectrum of rainbow colors can be created
.  
 colon cleansing level . at left is the original frame and at right is the elaborated image with white pixel 
dirty  areas and drri corresponding index . the sum of pixel values of the two zones contributed to the calculation of the cleanliness index for each frame being analyzed ( with values running from 0 to 3 , and 3 representing the highest degree of cleanliness ) .
the average of the indices for all of the frames resulted in an overall cleanliness index for a particular video ( fig . 
drri is calculated as follows : each frame is binarized , pixel by pixel : p  =  ( 0,0,0 ) if ( pr   
pg ) / ( pg - pb ) * 100  >  th ( dirty areas ) p  =  ( 255,255,255 ) if ( pr   
pg ) / ( pg - pb ) * 100    th ( clean areas ) where pr , pg , pb are respectively the component of red , yellow , and blue color value of the pixel , and th is the threshold value empirically determined by the characteristics of the device ( for this study set to th  =   400 ) % of the area with dirty pixels ( acovered ) and the number of distinct areolas present in the frame ( adistinct ) are calculated from a binarized frame .
if n sampled frame , with k from 1 to n , was estimated , the index of the  - th frame resulted :   drri : 3 if max ( acovered    2 * adistinct , 0 )  <  =  th1 2 if th1  <  max ( acovered    2 * adistinct , 0 )    th2 1 if th2  <  max ( acovered    2 * adistinct , 0 )    th3 0 if max ( acovered    2 * adistinct , 0 )  >  th3 th1 , th2 e th3 are threshold values that can be set . for this study , they were set to th1  =  0 , th2  =  3 , th3  =  20 the final value of drri is the average of drri sampled frames : fifty colonoscopy videos were collected in five different italian endoscopy units ( padova , milano , bassano del grappa , dolo , chioggia ) .
every video had a minimum resolution of at least 720  576 pixels and was saved in a digital video format ( .avi file ) .
all of the videos were anonymized and patients gave consent for recording of their colonoscopies .
colonoscopy videos were randomly collected by seven skilled endoscopists , using high - definition endoscopes , during routine and colorectal cancer screening sessions .
the colon was divided into three segments : cecum , ascending colon and hepatic flexure ( first segment ) ; transverse colon and descending colon ( second segment ) ; and the rectosigmoid segment ( third segment ) .
hepatic flexure was identified by the liver impression on colon , whereas the rectosigmoid segment was 35  cm from the anal verge .
every segment was recorded twice , once before and once after colon cleansing with water injection and aspiration of the residual feces in such a way as to achieve the best possible cleansing of the mucosa .
the clean colon software program ( ccsp ) is a mathematical algorithm applicable to all personal computers that objectively analyzes bowel cleansing during colonoscopy examinations and results in a numerical scoring ( dupuis - rosa - rizzotto index   
video - recordings of colonoscopies were analyzed using a threshold analysis by a software program that first sampled a number of frames ( depending on a frequency parameter related to the length of the video ) and then each frame wa assessed to distinguish clean from dirty zones , as explained in fig .  1 .
( e.  g. , red , pink , violet ) were separated from the  dirty  ones ( e.  g. , yellow , brown or green ) . 

flowchart of the software program the threshold was that value which , compared with a precise calculation based on normalized red - green - blue ( rgb ) values , made possible a distinction between the two types of zones : clean and dirty ( fig .  2 ) .
rgb coloring is predicated on the physical principle that any spectral color can be generated by mixing the three basic colors .
for example , if red and green are mixed at full intensity , bright yellow is generated , whereas a mixture of red and blue results in violet . if the three basic colors are mixed at different intensities , the whole spectrum of rainbow colors can be created
.  
 colon cleansing level . at left is the original frame and at right is the elaborated image with white pixel 
dirty  areas and drri corresponding index . the sum of pixel values of the two zones contributed to the calculation of the cleanliness index for each frame being analyzed ( with values running from 0 to 3 , and 3 representing the highest degree of cleanliness ) .
the average of the indices for all of the frames resulted in an overall cleanliness index for a particular video ( fig . 
drri is calculated as follows : each frame is binarized , pixel by pixel : p  =  ( 0,0,0 ) if ( pr   
pg ) / ( pg - pb ) * 100  >  th ( dirty areas ) p  =  ( 255,255,255 ) if ( pr   
pg ) / ( pg - pb ) * 100    th ( clean areas ) where pr , pg , pb are respectively the component of red , yellow , and blue color value of the pixel , and th is the threshold value empirically determined by the characteristics of the device ( for this study set to th  =   400 ) % of the area with dirty pixels ( acovered ) and the number of distinct areolas present in the frame ( adistinct ) are calculated from a binarized frame . if n sampled frame , with k from 1 to n , was estimated , the index of the  - th frame resulted :   drri : 3 if max ( acovered    2 * adistinct , 0 )  <  =  th1 2 if th1  <  max ( acovered    2 * adistinct , 0 )    th2 1 if th2  <  max ( acovered    2 * adistinct , 0 )    th3 0 if max ( acovered    2 * adistinct , 0 )  >  th3 th1 , th2 e th3 are threshold values that can be set . for this study , they were set to th1  =  0 , th2  =  3 , th3  =  20 the final value of drri is the average of drri sampled frames :
fifty colonoscopy videos were collected in five different italian endoscopy units ( padova , milano , bassano del grappa , dolo , chioggia ) . every video had a minimum resolution of at least 720  576 pixels and was saved in a digital video format ( .avi file ) .
all of the videos were anonymized and patients gave consent for recording of their colonoscopies .
colonoscopy videos were randomly collected by seven skilled endoscopists , using high - definition endoscopes , during routine and colorectal cancer screening sessions .
the colon was divided into three segments : cecum , ascending colon and hepatic flexure ( first segment ) ; transverse colon and descending colon ( second segment ) ; and the rectosigmoid segment ( third segment ) .
hepatic flexure was identified by the liver impression on colon , whereas the rectosigmoid segment was 35  cm from the anal verge .
every segment was recorded twice , once before and once after colon cleansing with water injection and aspiration of the residual feces in such a way as to achieve the best possible cleansing of the mucosa .
every segment was analyzed separately by our software . a t test for paired and unpaired data was used to define statistical significance
a blind evaluation of the aggregated 300 truncated colonoscopy videos was performed by four endoscopists from three different endoscopy units .
the validated boston bowel preparation scale ( bbps ) 7 was chosen to establish colon cleansing . before evaluating the colonoscopy videos
, each endoscopist viewed a 15-minute digital training video ( available on http://www.cori.org/bbps/instruction.php ) twice to enhance comprehension of bbps . 
each endoscopist visualized all of the colonoscopy videos over a period of 3 days and gave each video a score from 0 to 3 . 
we considered drri as the evaluation score of a fifth endoscopist and rounded up every score to the nearest integer . to assess interobserver reliability ,
the interclass correlation coefficient ( icc ) was calculated of the scores after viewing of the colonoscopies and from the software s drri , using the methods of shrout and fleiss 11 .
the strength of agreement was considered  very good  for icc values between 0.81 and 1 ,  good  between 0.61 and 0.80 ,  moderate 
between 0.41 and 0.60 ,  fair  between 0.21 and 0.40 , and  poor  at <  0.20 according to altman dg 12 

an improvement in cleansing was seen in all colon segments after lavage . the overall average ( sd ) drri score for pre - lavage colonoscopies was 1.56    0.52 versus 2.08    0.59 after lavage ( p  <  0.001 ) , for an approximate 33.3  % improvement in cleansing after post - lavage ( table  1).the mean drri for the first segment was 0.99    0.69 pre - lavage and of 1.80    0.80 post - lavage , demonstrating an improvement in cleansing of 88.1  % ( p  <  0,001 ) .
the drri for the second segment was 1.55    0.70 pre - lavage and 2.13    0.72 post - lavage , demonstrating an improvement in cleansing of 37.1  % ( p  <  0.001 ) . for the third segment ,
the drri was 2.07    0.71 pre - lavage and 2.46    0.56 post - lavage , for an improvement in cleansing of 18.8  % ( p  <  0,001 ) .
pre - lavage , the right colon segment was significantly dirtier ( drri 0.99 [ 0.69 ] ) than the left colon segment ( drri third segment 2.07    0.71 , p  <  0.0001 and drri second segment , 1.55    0.70 , p  <  0.001 ) .
a statistically significant difference in cleansing was recorded between the third and second segments ( 2.07    0,71 vs 1.55    0.70 , p  <  0.001 ) . 

cleanliness of each colonoscopy divided by segment as shown in table  2 , the overall interobserver agreement between endoscopists and the software pre - cleansing was 0.77 ( 95  % ci , 0.64   
0.86 ) and post - cleansing was 0.82 ( 95  % ci , 0.72   
the iccs for the first segment pre- and post - cleansing were 0.89 ( 95  % ci , 0,83    0.93 ) and 0.90 ( 95  % ci , 0.85    0.94 ) , for the second segment were 0.71 ( 95  % ci , 0.56   
0.82 ) and 0.77 ( 95  % ci , 0.64    0.86 ) and for the third segment were 0.77 ( 95  % ci , 0.64   
0.86 ) and 0.80 ( 95  % ci , 0.69    0.88 ) .
as explained in table  3 , we also calculated the interobserver agreement between each endoscopist and the software .
for the first endoscopist vs ccsp , the icc pre - cleansing was 0.64 ( 95  % ci , 0.50    0.74 ) and post - cleansing was 0.70 ( 95  % ci , 0.58   
0.78 ) ; for the second endoscopist , it was 0.65 ( 95  % ci , 0.53    0.70 ) pre - cleansing and 0.64 ( 95  % ci , 0.50    0.74 ) post - cleansing ; for the third endoscopist , the ccsp for pre - cleansing was 0.70 ( 95  % ci , 0.59    0.75 ) and for post - cleansing 0.71 ( 95  % ci , 0.60   
0.79 ) ; and for the fourth endoscopist , the ccsp for pre - cleansing was 0.69 ( 95  % ci , 0.57    0.78 ) and for post - cleansing it was 0.65 ( 95  % ci , 0.52    0.75 ) .
we then calculated the average bbps score across all four endoscopists and the interobserver correlation with drri score : pre - cleansing 0.87 ( 95  % ci , 0.84    0.90 ) and post - cleansing 0.86 ( 95  % ci , 0.83    0.89 ) . in the histogram in fig .  5
, the ordinate indicates the number of videos and the abscissa indicates the three colon segments subdivided by the scores for each endoscopist / ccsp and bbps / drri evaluation . 

total number of videos for all endoscopists and ccsp subdivided by cleansing score and colon segment
as demonstrated by the very good interobserver reliability between the software and the average cleansing score for the endoscopists , ccsp has the potential to become a reliable and universal method to objectively assess colon cleanliness , replacing the endoscopist s subjective point of view
.   a computer - assisted clean - colon scale could be an attractive alternative to the current proposed scales . with a system developed for clinical use
, the software would be inserted into an endoscopy videoprocessor to objectively evaluate and quantify in colon cleanliness in real time .
a drri established by the software in real time , while an exam is being carried out , could give the endoscopist an opportunity to compare his / her impression of colon cleanliness with that from the software . 
flat  lesions and serrated polyps , usually reported in the right colon , can be missed if the mucosal surface is not clean enough 13 
 14 
 15 .
it would be of particular diagnostic interest if the program makes it possible to identify a threshold of cleansing that would minimize missed lesions and improve colonoscopy quality as defined by completion rates , technique , and accuracy of inspection .  
furthermore , despite all the evidence , it remains difficult to select the best bowel preparation because many studies conducted in that areas are subject to bias .
thus , ccsp could be a good method to easily determine if one preparation is better than another , surpassing the old and intricate concept of interobserver and intraobserver agreement for establishing in clinical trials which of two bowel preparations results in the best cleansing .   during the development of the software , we struggled with the problem of melanosis coli , especially when the condition was severe .
in fact , with it , the software recognizes the mucosa as dirty even when it is clean .
we have not yet overcome that problem , but we are trying to recalibrate the software to account for this relatively frequent occurrence 16 .
another critical aspect of this method are the variables that can occur during the exam itself ( e.  g. , polypectomy or biopsy ) . at those points ,
the video should focus on a particular zone of the colon that , from the viewpoint of cleanliness , is of interest only in regard to the index of the first frame sample in that zone .
the software should automatically record the frames that follow and take them into consideration once the scope starts to move forward again . in order to account for all possible variables found in clinical practice , both anatomic and procedural , an ample quantity of video data recorded by a large number of endoscopists using different equipment
is needed so that the grading of bowel preparation can be defined and the software application modified as needed . in conclusion ,
our preliminary data show that the clean colon software program is able to distinguish between clean and non - clean colon tracts and it is comparable to the validated boston bowel preparation scale . to our knowledge
, this is the first objective method of establishing colon cleansing that has been described in the literature .
 
 background and study aims : neoplastic lesions can be missed during colonoscopy , especially when cleansing is inadequate . 
 bowel preparation scales have significant limitations and no objective and standardized method currently exists to establish colon cleanliness during colonoscopy . 
 the aims of our study are to create a software algorithm that is able to analyze bowel cleansing during colonoscopies and to compare it to a validate bowel preparation scale . 
 patients and methods : a software application ( the clean colon software program , ccsp ) was developed . 
 fifty colonoscopies were carried out and video - recorded . 
 each video was divided into 3 segments : cecum - hepatic flexure ( 1st segment ) , hepatic flexure - descending colon ( 2nd segment ) and rectosigmoid segment ( 3rd segment ) . 
 each segment was recorded twice , both before and after careful cleansing of the intestinal wall . a score from 0 ( dirty ) to 3 ( clean ) was then assigned by ccsp . 
 all the videos were also viewed by four endoscopists and colon cleansing was established using the boston bowel preparation scale . 
 interclass correlation coefficient was then calculated between the endoscopists and the software . 
 
 results : the cleansing score of the prelavage colonoscopies was 1.56    0.52 and the postlavage one was 2,08    0,59 ( p  <  
 0.001 ) showing an approximate 33.3  % improvement in cleansing after lavage . 
 right colon segment prelavage ( 0.99    0.69 ) was dirtier than left colon segment prelavage ( 2.07    0.71 ) . 
 the overall interobserver agreement between the average cleansing score for the 4 endoscopists and the software pre - cleansing was 0.87 ( 95  % ci , 0.84    0.90 ) and post - cleansing was 0.86 ( 95  % ci , 0.83    
 0.89 ) . 
 
 conclusions : the software is able to discriminate clean from non - clean colon tracts with high significance and is comparable to endoscopist evaluation . 
Introduction
Materials and methods
Software application
Dupuis-Rosa-Rizzotto IndexDRRI
Colonoscopy video collection
Comparison between CCSP and Boston Bowel Preparation Scale
Results
Discussion